/* Generated by Cython 0.28.3 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "core/tree/rb_node_valued.tpp",
            "core/tree/rb_tree.tppcore/tree/rb_node.tpp",
            "core/tree/tree.hpp",
            "core/trees_iterator/iterator.hpp",
            "core/trees_iterator/iterator.tpp",
            "redblackpy/core/tree/rb_node_valued.tpp",
            "redblackpy/core/tree/tree.hpp",
            "redblackpy/core/trees_iterator/iterator.hpp",
            "redblackpy/core/trees_iterator/iterator.tpp"
        ],
        "extra_compile_args": [
            "-std=c++11",
            "-mmacosx-version-min=10.7",
            "-stdlib=libc++",
            "-Ofast"
        ],
        "include_dirs": [
            "./redblackpy"
        ],
        "language": "c++",
        "name": "redblackpy.series.tree_series",
        "sources": [
            "redblackpy/series/tree_series.pyx"
        ]
    },
    "module_name": "redblackpy.series.tree_series"
}
END: Cython Metadata */

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

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

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

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


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

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

#define __PYX_HAVE__redblackpy__series__tree_series
#define __PYX_HAVE_API__redblackpy__series__tree_series
/* Early includes */
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include "ios"
#include "new"
#include "stdexcept"
#include "typeinfo"
#include <utility>
#include <unordered_map>
#include <string>
#include <vector>
#include <core/tree/tree.hpp>
#include <core/trees_iterator/iterator.hpp>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

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

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

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


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

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


static const char *__pyx_f[] = {
  "redblackpy/series/../cython_source/trees_iterator.pxi",
  "redblackpy/series/tree_series.pyx",
  "redblackpy/series/../cython_source/base_tree_series.pxi",
  "redblackpy/series/../cython_source/tree_series_dtype.pxi",
  "stringsource",
  "redblackpy/series/../cython_source/interpolation.pxi",
  "redblackpy/series/../cython_source/arithmetic.pxi",
  "redblackpy/series/../cython_source/dtype_tree_processing.pxi",
  "redblackpy/series/../cython_source/object_tree_processing.pxi",
  "redblackpy/series/tree_series.pxd",
  "type.pxd",
};
/* ForceInitThreads.proto */
#ifndef __PYX_FORCE_INIT_THREADS
  #define __PYX_FORCE_INIT_THREADS 0
#endif

/* NoFastGil.proto */
#define __Pyx_PyGILState_Ensure PyGILState_Ensure
#define __Pyx_PyGILState_Release PyGILState_Release
#define __Pyx_FastGIL_Remember()
#define __Pyx_FastGIL_Forget()
#define __Pyx_FastGilFuncInit()


/* "redblackpy/tree_cython_api/types_mapping.pxd":12
 * # Integers
 * #--------------------------------------------------------------------------------------------
 * ctypedef unsigned char      uint8_t             # <<<<<<<<<<<<<<
 * ctypedef unsigned short     uint16_t
 * ctypedef unsigned int       uint32_t
 */
typedef unsigned char __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":13
 * #--------------------------------------------------------------------------------------------
 * ctypedef unsigned char      uint8_t
 * ctypedef unsigned short     uint16_t             # <<<<<<<<<<<<<<
 * ctypedef unsigned int       uint32_t
 * ctypedef unsigned long long uint64_t
 */
typedef unsigned short __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":14
 * ctypedef unsigned char      uint8_t
 * ctypedef unsigned short     uint16_t
 * ctypedef unsigned int       uint32_t             # <<<<<<<<<<<<<<
 * ctypedef unsigned long long uint64_t
 * ctypedef unsigned long long uint96_t
 */
typedef unsigned int __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":15
 * ctypedef unsigned short     uint16_t
 * ctypedef unsigned int       uint32_t
 * ctypedef unsigned long long uint64_t             # <<<<<<<<<<<<<<
 * ctypedef unsigned long long uint96_t
 * ctypedef unsigned long long uint128_t
 */
typedef unsigned PY_LONG_LONG __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":16
 * ctypedef unsigned int       uint32_t
 * ctypedef unsigned long long uint64_t
 * ctypedef unsigned long long uint96_t             # <<<<<<<<<<<<<<
 * ctypedef unsigned long long uint128_t
 * 
 */
typedef unsigned PY_LONG_LONG __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":17
 * ctypedef unsigned long long uint64_t
 * ctypedef unsigned long long uint96_t
 * ctypedef unsigned long long uint128_t             # <<<<<<<<<<<<<<
 * 
 * ctypedef signed char        int8_t
 */
typedef unsigned PY_LONG_LONG __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":19
 * ctypedef unsigned long long uint128_t
 * 
 * ctypedef signed char        int8_t             # <<<<<<<<<<<<<<
 * ctypedef signed short       int16_t
 * ctypedef signed int         int32_t
 */
typedef signed char __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":20
 * 
 * ctypedef signed char        int8_t
 * ctypedef signed short       int16_t             # <<<<<<<<<<<<<<
 * ctypedef signed int         int32_t
 * ctypedef signed long long   int64_t
 */
typedef short __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":21
 * ctypedef signed char        int8_t
 * ctypedef signed short       int16_t
 * ctypedef signed int         int32_t             # <<<<<<<<<<<<<<
 * ctypedef signed long long   int64_t
 * ctypedef signed long long   int96_t
 */
typedef int __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":22
 * ctypedef signed short       int16_t
 * ctypedef signed int         int32_t
 * ctypedef signed long long   int64_t             # <<<<<<<<<<<<<<
 * ctypedef signed long long   int96_t
 * ctypedef signed long long   int128_t
 */
typedef PY_LONG_LONG __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":23
 * ctypedef signed int         int32_t
 * ctypedef signed long long   int64_t
 * ctypedef signed long long   int96_t             # <<<<<<<<<<<<<<
 * ctypedef signed long long   int128_t
 * 
 */
typedef PY_LONG_LONG __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":24
 * ctypedef signed long long   int64_t
 * ctypedef signed long long   int96_t
 * ctypedef signed long long   int128_t             # <<<<<<<<<<<<<<
 * 
 * # Floating point types
 */
typedef PY_LONG_LONG __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":28
 * # Floating point types
 * #--------------------------------------------------------------------------------------------
 * ctypedef float              float32_t             # <<<<<<<<<<<<<<
 * ctypedef double             float64_t
 * ctypedef long double        float80_t
 */
typedef float __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":29
 * #--------------------------------------------------------------------------------------------
 * ctypedef float              float32_t
 * ctypedef double             float64_t             # <<<<<<<<<<<<<<
 * ctypedef long double        float80_t
 * ctypedef long double        float96_t
 */
typedef double __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":30
 * ctypedef float              float32_t
 * ctypedef double             float64_t
 * ctypedef long double        float80_t             # <<<<<<<<<<<<<<
 * ctypedef long double        float96_t
 * ctypedef long double        float128_t
 */
typedef long double __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":31
 * ctypedef double             float64_t
 * ctypedef long double        float80_t
 * ctypedef long double        float96_t             # <<<<<<<<<<<<<<
 * ctypedef long double        float128_t
 */
typedef long double __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t;

/* "redblackpy/tree_cython_api/types_mapping.pxd":32
 * ctypedef long double        float80_t
 * ctypedef long double        float96_t
 * ctypedef long double        float128_t             # <<<<<<<<<<<<<<
 */
typedef long double __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t;

/*--- Type declarations ---*/
struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries;
struct __pyx_obj_10redblackpy_6series_11tree_series_Series;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t;
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems;
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__;
struct __pyx_t_10redblackpy_6series_11tree_series_c_pyobject;
typedef struct __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_10redblackpy_6series_11tree_series_c_pyobject;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace;
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data;

/* "redblackpy/series/tree_series.pxd":25
 * 
 * 
 * cdef enum RedBlackPyError:             # <<<<<<<<<<<<<<
 *     INT_KEY_ERROR = -1
 *     EXT_KEY_ERROR = -2
 */
enum __pyx_t_10redblackpy_6series_11tree_series_RedBlackPyError {
  __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR = -1L,
  __pyx_e_10redblackpy_6series_11tree_series_EXT_KEY_ERROR = -2L,
  __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR = -3L
};

/* "redblackpy/series/tree_series.pxd":36
 *     int PyObject_RichCompareBool(PyObject* o1, PyObject* o2, int opid)
 * 
 * ctypedef struct c_pyobject:             # <<<<<<<<<<<<<<
 *     PyObject* data
 * 
 */
struct __pyx_t_10redblackpy_6series_11tree_series_c_pyobject {
  PyObject *data;
};

/* "redblackpy/series/tree_series.pxd":41
 * # Typedefs
 * #--------------------------------------------------------------------------------------------
 * ctypedef void*                                              void_ptr             # <<<<<<<<<<<<<<
 * ctypedef tree.rb_node_valued[c_pyobject, void_ptr]          rb_node_valued
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]           rb_tree
 */
typedef void *__pyx_t_10redblackpy_6series_11tree_series_void_ptr;

/* "redblackpy/series/tree_series.pxd":42
 * #--------------------------------------------------------------------------------------------
 * ctypedef void*                                              void_ptr
 * ctypedef tree.rb_node_valued[c_pyobject, void_ptr]          rb_node_valued             # <<<<<<<<<<<<<<
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]           rb_tree
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]*          rb_tree_ptr
 */
typedef qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr>  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued;

/* "redblackpy/series/tree_series.pxd":43
 * ctypedef void*                                              void_ptr
 * ctypedef tree.rb_node_valued[c_pyobject, void_ptr]          rb_node_valued
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]           rb_tree             # <<<<<<<<<<<<<<
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]*          rb_tree_ptr
 * ctypedef rb_node_valued*                                    node_ptr
 */
typedef qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  __pyx_t_10redblackpy_6series_11tree_series_rb_tree;

/* "redblackpy/series/tree_series.pxd":44
 * ctypedef tree.rb_node_valued[c_pyobject, void_ptr]          rb_node_valued
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]           rb_tree
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]*          rb_tree_ptr             # <<<<<<<<<<<<<<
 * ctypedef rb_node_valued*                                    node_ptr
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject].iterator  iterator
 */
typedef qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr;

/* "redblackpy/series/tree_series.pxd":45
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]           rb_tree
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]*          rb_tree_ptr
 * ctypedef rb_node_valued*                                    node_ptr             # <<<<<<<<<<<<<<
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject].iterator  iterator
 * #--------------------------------------------------------------------------------------------
 */
typedef __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_10redblackpy_6series_11tree_series_node_ptr;

/* "redblackpy/series/tree_series.pxd":46
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject]*          rb_tree_ptr
 * ctypedef rb_node_valued*                                    node_ptr
 * ctypedef tree.rb_tree[rb_node_valued, c_pyobject].iterator  iterator             # <<<<<<<<<<<<<<
 * #--------------------------------------------------------------------------------------------
 * cdef c_pyobject to_c_pyobject(object obj)
 */
typedef qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_10redblackpy_6series_11tree_series_iterator;

/* "redblackpy/series/tree_series.pxd":104
 *     cpdef Series truncate(self, start, stop)
 *     cpdef Series uniform(self, start, stop, step)
 *     cpdef map(self, method, bint inplace=*, tuple args=*, dict kwargs=*)             # <<<<<<<<<<<<<<
 *     cpdef void set_interpolation(self, str interpolate)
 *     cpdef void set_extrapolation(self, extrapolate)
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map {
  int __pyx_n;
  int inplace;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/interpolation.pxi":9
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint8_t ( *interpolate_uint8_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    uint8_t, int32_t* )
 * ctypedef uint8_t (*itermode_search_uint8_t)(__TreeSeries_uint8_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint8_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":11
 * ctypedef uint8_t ( *interpolate_uint8_t)(node_ptr, node_ptr, object, node_ptr,
 *                    uint8_t, int32_t* )
 * ctypedef uint8_t (*itermode_search_uint8_t)(__TreeSeries_uint8_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint8_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":108
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint16_t ( *interpolate_uint16_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    uint16_t, int32_t* )
 * ctypedef uint16_t (*itermode_search_uint16_t)(__TreeSeries_uint16_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint16_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":110
 * ctypedef uint16_t ( *interpolate_uint16_t)(node_ptr, node_ptr, object, node_ptr,
 *                    uint16_t, int32_t* )
 * ctypedef uint16_t (*itermode_search_uint16_t)(__TreeSeries_uint16_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint16_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":207
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint32_t ( *interpolate_uint32_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    uint32_t, int32_t* )
 * ctypedef uint32_t (*itermode_search_uint32_t)(__TreeSeries_uint32_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint32_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":209
 * ctypedef uint32_t ( *interpolate_uint32_t)(node_ptr, node_ptr, object, node_ptr,
 *                    uint32_t, int32_t* )
 * ctypedef uint32_t (*itermode_search_uint32_t)(__TreeSeries_uint32_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint32_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":306
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint64_t ( *interpolate_uint64_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    uint64_t, int32_t* )
 * ctypedef uint64_t (*itermode_search_uint64_t)(__TreeSeries_uint64_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint64_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":308
 * ctypedef uint64_t ( *interpolate_uint64_t)(node_ptr, node_ptr, object, node_ptr,
 *                    uint64_t, int32_t* )
 * ctypedef uint64_t (*itermode_search_uint64_t)(__TreeSeries_uint64_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint64_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":405
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint96_t ( *interpolate_uint96_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    uint96_t, int32_t* )
 * ctypedef uint96_t (*itermode_search_uint96_t)(__TreeSeries_uint96_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint96_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":407
 * ctypedef uint96_t ( *interpolate_uint96_t)(node_ptr, node_ptr, object, node_ptr,
 *                    uint96_t, int32_t* )
 * ctypedef uint96_t (*itermode_search_uint96_t)(__TreeSeries_uint96_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint96_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":504
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint128_t ( *interpolate_uint128_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    uint128_t, int32_t* )
 * ctypedef uint128_t (*itermode_search_uint128_t)(__TreeSeries_uint128_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint128_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":506
 * ctypedef uint128_t ( *interpolate_uint128_t)(node_ptr, node_ptr, object, node_ptr,
 *                    uint128_t, int32_t* )
 * ctypedef uint128_t (*itermode_search_uint128_t)(__TreeSeries_uint128_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint128_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":603
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef int8_t ( *interpolate_int8_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    int8_t, int32_t* )
 * ctypedef int8_t (*itermode_search_int8_t)(__TreeSeries_int8_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_int8_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":605
 * ctypedef int8_t ( *interpolate_int8_t)(node_ptr, node_ptr, object, node_ptr,
 *                    int8_t, int32_t* )
 * ctypedef int8_t (*itermode_search_int8_t)(__TreeSeries_int8_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_int8_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":702
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef int16_t ( *interpolate_int16_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    int16_t, int32_t* )
 * ctypedef int16_t (*itermode_search_int16_t)(__TreeSeries_int16_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_int16_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":704
 * ctypedef int16_t ( *interpolate_int16_t)(node_ptr, node_ptr, object, node_ptr,
 *                    int16_t, int32_t* )
 * ctypedef int16_t (*itermode_search_int16_t)(__TreeSeries_int16_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_int16_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":801
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef int32_t ( *interpolate_int32_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    int32_t, int32_t* )
 * ctypedef int32_t (*itermode_search_int32_t)(__TreeSeries_int32_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_int32_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":803
 * ctypedef int32_t ( *interpolate_int32_t)(node_ptr, node_ptr, object, node_ptr,
 *                    int32_t, int32_t* )
 * ctypedef int32_t (*itermode_search_int32_t)(__TreeSeries_int32_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_int32_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":900
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef int64_t ( *interpolate_int64_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    int64_t, int32_t* )
 * ctypedef int64_t (*itermode_search_int64_t)(__TreeSeries_int64_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_int64_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":902
 * ctypedef int64_t ( *interpolate_int64_t)(node_ptr, node_ptr, object, node_ptr,
 *                    int64_t, int32_t* )
 * ctypedef int64_t (*itermode_search_int64_t)(__TreeSeries_int64_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_int64_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":999
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef int96_t ( *interpolate_int96_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    int96_t, int32_t* )
 * ctypedef int96_t (*itermode_search_int96_t)(__TreeSeries_int96_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_int96_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1001
 * ctypedef int96_t ( *interpolate_int96_t)(node_ptr, node_ptr, object, node_ptr,
 *                    int96_t, int32_t* )
 * ctypedef int96_t (*itermode_search_int96_t)(__TreeSeries_int96_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_int96_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1098
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef int128_t ( *interpolate_int128_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    int128_t, int32_t* )
 * ctypedef int128_t (*itermode_search_int128_t)(__TreeSeries_int128_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_int128_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1100
 * ctypedef int128_t ( *interpolate_int128_t)(node_ptr, node_ptr, object, node_ptr,
 *                    int128_t, int32_t* )
 * ctypedef int128_t (*itermode_search_int128_t)(__TreeSeries_int128_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_int128_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1197
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef float32_t ( *interpolate_float32_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    float32_t, int32_t* )
 * ctypedef float32_t (*itermode_search_float32_t)(__TreeSeries_float32_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_float32_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1199
 * ctypedef float32_t ( *interpolate_float32_t)(node_ptr, node_ptr, object, node_ptr,
 *                    float32_t, int32_t* )
 * ctypedef float32_t (*itermode_search_float32_t)(__TreeSeries_float32_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_float32_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1296
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef float64_t ( *interpolate_float64_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    float64_t, int32_t* )
 * ctypedef float64_t (*itermode_search_float64_t)(__TreeSeries_float64_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_float64_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1298
 * ctypedef float64_t ( *interpolate_float64_t)(node_ptr, node_ptr, object, node_ptr,
 *                    float64_t, int32_t* )
 * ctypedef float64_t (*itermode_search_float64_t)(__TreeSeries_float64_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_float64_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1395
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef float80_t ( *interpolate_float80_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    float80_t, int32_t* )
 * ctypedef float80_t (*itermode_search_float80_t)(__TreeSeries_float80_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_float80_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1397
 * ctypedef float80_t ( *interpolate_float80_t)(node_ptr, node_ptr, object, node_ptr,
 *                    float80_t, int32_t* )
 * ctypedef float80_t (*itermode_search_float80_t)(__TreeSeries_float80_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_float80_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1494
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef float96_t ( *interpolate_float96_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    float96_t, int32_t* )
 * ctypedef float96_t (*itermode_search_float96_t)(__TreeSeries_float96_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_float96_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1496
 * ctypedef float96_t ( *interpolate_float96_t)(node_ptr, node_ptr, object, node_ptr,
 *                    float96_t, int32_t* )
 * ctypedef float96_t (*itermode_search_float96_t)(__TreeSeries_float96_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_float96_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1593
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef float128_t ( *interpolate_float128_t)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    float128_t, int32_t* )
 * ctypedef float128_t (*itermode_search_float128_t)(__TreeSeries_float128_t, object, int32_t*)
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx_t_10redblackpy_6series_11tree_series_interpolate_float128_t)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1595
 * ctypedef float128_t ( *interpolate_float128_t)(node_ptr, node_ptr, object, node_ptr,
 *                    float128_t, int32_t* )
 * ctypedef float128_t (*itermode_search_float128_t)(__TreeSeries_float128_t, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_float128_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1692
 * # Basics interpolation implementation.
 * #--------------------------------------------------------------------------------------------
 * ctypedef object ( *interpolate_object)(node_ptr, node_ptr, object, node_ptr,             # <<<<<<<<<<<<<<
 *                    object, int32_t* )
 * ctypedef object (*itermode_search_object)(__TreeSeries_object, object, int32_t*)
 */
typedef PyObject *(*__pyx_t_10redblackpy_6series_11tree_series_interpolate_object)(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/interpolation.pxi":1694
 * ctypedef object ( *interpolate_object)(node_ptr, node_ptr, object, node_ptr,
 *                    object, int32_t* )
 * ctypedef object (*itermode_search_object)(__TreeSeries_object, object, int32_t*)             # <<<<<<<<<<<<<<
 * 
 * 
 */
typedef PyObject *(*__pyx_t_10redblackpy_6series_11tree_series_itermode_search_object)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);

/* "redblackpy/cython_source/arithmetic.pxi":9
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint8_t (*arithmetic_uint8_t)(uint8_t, uint8_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_uint8_t (*arithmetic_type_uint8_t)( __TreeSeries_uint8_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t);

/* "redblackpy/cython_source/arithmetic.pxi":10
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint8_t (*arithmetic_uint8_t)(uint8_t, uint8_t)
 * ctypedef __TreeSeries_uint8_t (*arithmetic_type_uint8_t)( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_uint8_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint8_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t);

/* "redblackpy/cython_source/arithmetic.pxi":41
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint16_t (*arithmetic_uint16_t)(uint16_t, uint16_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_uint16_t (*arithmetic_type_uint16_t)( __TreeSeries_uint16_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t);

/* "redblackpy/cython_source/arithmetic.pxi":42
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint16_t (*arithmetic_uint16_t)(uint16_t, uint16_t)
 * ctypedef __TreeSeries_uint16_t (*arithmetic_type_uint16_t)( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_uint16_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint16_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t);

/* "redblackpy/cython_source/arithmetic.pxi":73
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint32_t (*arithmetic_uint32_t)(uint32_t, uint32_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_uint32_t (*arithmetic_type_uint32_t)( __TreeSeries_uint32_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t);

/* "redblackpy/cython_source/arithmetic.pxi":74
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint32_t (*arithmetic_uint32_t)(uint32_t, uint32_t)
 * ctypedef __TreeSeries_uint32_t (*arithmetic_type_uint32_t)( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_uint32_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint32_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t);

/* "redblackpy/cython_source/arithmetic.pxi":105
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint64_t (*arithmetic_uint64_t)(uint64_t, uint64_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_uint64_t (*arithmetic_type_uint64_t)( __TreeSeries_uint64_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t);

/* "redblackpy/cython_source/arithmetic.pxi":106
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint64_t (*arithmetic_uint64_t)(uint64_t, uint64_t)
 * ctypedef __TreeSeries_uint64_t (*arithmetic_type_uint64_t)( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_uint64_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint64_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t);

/* "redblackpy/cython_source/arithmetic.pxi":137
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint96_t (*arithmetic_uint96_t)(uint96_t, uint96_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_uint96_t (*arithmetic_type_uint96_t)( __TreeSeries_uint96_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t);

/* "redblackpy/cython_source/arithmetic.pxi":138
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint96_t (*arithmetic_uint96_t)(uint96_t, uint96_t)
 * ctypedef __TreeSeries_uint96_t (*arithmetic_type_uint96_t)( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_uint96_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint96_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t);

/* "redblackpy/cython_source/arithmetic.pxi":169
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint128_t (*arithmetic_uint128_t)(uint128_t, uint128_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_uint128_t (*arithmetic_type_uint128_t)( __TreeSeries_uint128_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t);

/* "redblackpy/cython_source/arithmetic.pxi":170
 * #--------------------------------------------------------------------------------------------
 * ctypedef uint128_t (*arithmetic_uint128_t)(uint128_t, uint128_t)
 * ctypedef __TreeSeries_uint128_t (*arithmetic_type_uint128_t)( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_uint128_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint128_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t);

/* "redblackpy/cython_source/arithmetic.pxi":201
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef int8_t (*arithmetic_int8_t)(int8_t, int8_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_int8_t (*arithmetic_type_int8_t)( __TreeSeries_int8_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t);

/* "redblackpy/cython_source/arithmetic.pxi":202
 * #--------------------------------------------------------------------------------------------
 * ctypedef int8_t (*arithmetic_int8_t)(int8_t, int8_t)
 * ctypedef __TreeSeries_int8_t (*arithmetic_type_int8_t)( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_int8_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int8_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t);

/* "redblackpy/cython_source/arithmetic.pxi":233
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef int16_t (*arithmetic_int16_t)(int16_t, int16_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_int16_t (*arithmetic_type_int16_t)( __TreeSeries_int16_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t);

/* "redblackpy/cython_source/arithmetic.pxi":234
 * #--------------------------------------------------------------------------------------------
 * ctypedef int16_t (*arithmetic_int16_t)(int16_t, int16_t)
 * ctypedef __TreeSeries_int16_t (*arithmetic_type_int16_t)( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_int16_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int16_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t);

/* "redblackpy/cython_source/arithmetic.pxi":265
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef int32_t (*arithmetic_int32_t)(int32_t, int32_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_int32_t (*arithmetic_type_int32_t)( __TreeSeries_int32_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t);

/* "redblackpy/cython_source/arithmetic.pxi":266
 * #--------------------------------------------------------------------------------------------
 * ctypedef int32_t (*arithmetic_int32_t)(int32_t, int32_t)
 * ctypedef __TreeSeries_int32_t (*arithmetic_type_int32_t)( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_int32_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int32_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t);

/* "redblackpy/cython_source/arithmetic.pxi":297
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef int64_t (*arithmetic_int64_t)(int64_t, int64_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_int64_t (*arithmetic_type_int64_t)( __TreeSeries_int64_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t);

/* "redblackpy/cython_source/arithmetic.pxi":298
 * #--------------------------------------------------------------------------------------------
 * ctypedef int64_t (*arithmetic_int64_t)(int64_t, int64_t)
 * ctypedef __TreeSeries_int64_t (*arithmetic_type_int64_t)( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_int64_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int64_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t);

/* "redblackpy/cython_source/arithmetic.pxi":329
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef int96_t (*arithmetic_int96_t)(int96_t, int96_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_int96_t (*arithmetic_type_int96_t)( __TreeSeries_int96_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t);

/* "redblackpy/cython_source/arithmetic.pxi":330
 * #--------------------------------------------------------------------------------------------
 * ctypedef int96_t (*arithmetic_int96_t)(int96_t, int96_t)
 * ctypedef __TreeSeries_int96_t (*arithmetic_type_int96_t)( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_int96_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int96_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t);

/* "redblackpy/cython_source/arithmetic.pxi":361
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef int128_t (*arithmetic_int128_t)(int128_t, int128_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_int128_t (*arithmetic_type_int128_t)( __TreeSeries_int128_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t);

/* "redblackpy/cython_source/arithmetic.pxi":362
 * #--------------------------------------------------------------------------------------------
 * ctypedef int128_t (*arithmetic_int128_t)(int128_t, int128_t)
 * ctypedef __TreeSeries_int128_t (*arithmetic_type_int128_t)( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_int128_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int128_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t);

/* "redblackpy/cython_source/arithmetic.pxi":393
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef float32_t (*arithmetic_float32_t)(float32_t, float32_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_float32_t (*arithmetic_type_float32_t)( __TreeSeries_float32_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t);

/* "redblackpy/cython_source/arithmetic.pxi":394
 * #--------------------------------------------------------------------------------------------
 * ctypedef float32_t (*arithmetic_float32_t)(float32_t, float32_t)
 * ctypedef __TreeSeries_float32_t (*arithmetic_type_float32_t)( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_float32_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float32_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t);

/* "redblackpy/cython_source/arithmetic.pxi":425
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef float64_t (*arithmetic_float64_t)(float64_t, float64_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_float64_t (*arithmetic_type_float64_t)( __TreeSeries_float64_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t);

/* "redblackpy/cython_source/arithmetic.pxi":426
 * #--------------------------------------------------------------------------------------------
 * ctypedef float64_t (*arithmetic_float64_t)(float64_t, float64_t)
 * ctypedef __TreeSeries_float64_t (*arithmetic_type_float64_t)( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_float64_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float64_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t);

/* "redblackpy/cython_source/arithmetic.pxi":457
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef float80_t (*arithmetic_float80_t)(float80_t, float80_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_float80_t (*arithmetic_type_float80_t)( __TreeSeries_float80_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t);

/* "redblackpy/cython_source/arithmetic.pxi":458
 * #--------------------------------------------------------------------------------------------
 * ctypedef float80_t (*arithmetic_float80_t)(float80_t, float80_t)
 * ctypedef __TreeSeries_float80_t (*arithmetic_type_float80_t)( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_float80_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float80_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t);

/* "redblackpy/cython_source/arithmetic.pxi":489
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef float96_t (*arithmetic_float96_t)(float96_t, float96_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_float96_t (*arithmetic_type_float96_t)( __TreeSeries_float96_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t);

/* "redblackpy/cython_source/arithmetic.pxi":490
 * #--------------------------------------------------------------------------------------------
 * ctypedef float96_t (*arithmetic_float96_t)(float96_t, float96_t)
 * ctypedef __TreeSeries_float96_t (*arithmetic_type_float96_t)( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_float96_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float96_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t);

/* "redblackpy/cython_source/arithmetic.pxi":521
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef float128_t (*arithmetic_float128_t)(float128_t, float128_t)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_float128_t (*arithmetic_type_float128_t)( __TreeSeries_float128_t,
 * 													      __BaseTreeSeries,
 */
typedef __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t)(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t);

/* "redblackpy/cython_source/arithmetic.pxi":522
 * #--------------------------------------------------------------------------------------------
 * ctypedef float128_t (*arithmetic_float128_t)(float128_t, float128_t)
 * ctypedef __TreeSeries_float128_t (*arithmetic_type_float128_t)( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_float128_t )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float128_t)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t);

/* "redblackpy/cython_source/arithmetic.pxi":553
 * # Arithmetic helpers
 * #--------------------------------------------------------------------------------------------
 * ctypedef object (*arithmetic_object)(object, object)             # <<<<<<<<<<<<<<
 * ctypedef __TreeSeries_object (*arithmetic_type_object)( __TreeSeries_object,
 * 													      __BaseTreeSeries,
 */
typedef PyObject *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_object)(PyObject *, PyObject *);

/* "redblackpy/cython_source/arithmetic.pxi":554
 * #--------------------------------------------------------------------------------------------
 * ctypedef object (*arithmetic_object)(object, object)
 * ctypedef __TreeSeries_object (*arithmetic_type_object)( __TreeSeries_object,             # <<<<<<<<<<<<<<
 * 													      __BaseTreeSeries,
 *                                                           arithmetic_object )
 */
typedef struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_object)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object);

/* "redblackpy/cython_source/tree_series_dtype.pxi":190
 * 
 * 
 *     cpdef __TreeSeries_uint8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":206
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":244
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":793
 * 
 * 
 *     cpdef __TreeSeries_uint16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":809
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":847
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":1396
 * 
 * 
 *     cpdef __TreeSeries_uint32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":1412
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":1450
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":1999
 * 
 * 
 *     cpdef __TreeSeries_uint64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":2015
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":2053
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":2602
 * 
 * 
 *     cpdef __TreeSeries_uint96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":2618
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":2656
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":3205
 * 
 * 
 *     cpdef __TreeSeries_uint128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":3221
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":3259
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":3808
 * 
 * 
 *     cpdef __TreeSeries_int8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":3824
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":3862
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":4411
 * 
 * 
 *     cpdef __TreeSeries_int16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":4427
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":4465
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":5014
 * 
 * 
 *     cpdef __TreeSeries_int32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":5030
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":5068
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":5617
 * 
 * 
 *     cpdef __TreeSeries_int64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":5633
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":5671
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":6220
 * 
 * 
 *     cpdef __TreeSeries_int96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":6236
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":6274
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":6823
 * 
 * 
 *     cpdef __TreeSeries_int128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":6839
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":6877
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":7426
 * 
 * 
 *     cpdef __TreeSeries_float32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":7442
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":7480
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":8029
 * 
 * 
 *     cpdef __TreeSeries_float64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":8045
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":8083
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":8632
 * 
 * 
 *     cpdef __TreeSeries_float80_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":8648
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":8686
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":9235
 * 
 * 
 *     cpdef __TreeSeries_float96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":9251
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":9289
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":9838
 * 
 * 
 *     cpdef __TreeSeries_float128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":9854
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":9892
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":10441
 * 
 * 
 *     cpdef __TreeSeries_object map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":10457
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace {
  int __pyx_n;
  PyObject *args;
  PyObject *kwargs;
};

/* "redblackpy/cython_source/tree_series_dtype.pxi":10495
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */
struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data {
  int __pyx_n;
  PyObject *to_type;
};

/* "redblackpy/series/tree_series.pxd":60
 * # Base series class definition
 * #--------------------------------------------------------------------------------------------
 * cdef class __BaseTreeSeries:             # <<<<<<<<<<<<<<
 * 
 *     # Attributes
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries {
  PyObject_HEAD
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_vtab;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx___index;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx___last_call;
  bool __pyx___iter_mode;
};


/* "redblackpy/series/tree_series.pxd":83
 * # Series class definition
 * #--------------------------------------------------------------------------------------------
 * cdef class Series:             # <<<<<<<<<<<<<<
 * 
 *     # Attributes
 */
struct __pyx_obj_10redblackpy_6series_11tree_series_Series {
  PyObject_HEAD
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *__pyx_vtab;
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *dtype_series;
  PyObject *name;
  PyObject *dtype;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":2
 * @cython.internal
 * cdef class __TreeSeries_uint8_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint8_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_uint8_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint8_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint8_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":605
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint16_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint16_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_uint16_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint16_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint16_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":1208
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint32_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint32_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_uint32_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint32_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint32_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":1811
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint64_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint64_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_uint64_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint64_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint64_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":2414
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint96_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint96_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_uint96_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint96_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint96_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":3017
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint128_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint128_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_uint128_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_uint128_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_uint128_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":3620
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int8_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int8_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_int8_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_int8_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int8_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":4223
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int16_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int16_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_int16_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_int16_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int16_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":4826
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int32_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int32_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_int32_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_int32_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int32_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":5429
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int64_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int64_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_int64_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_int64_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int64_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":6032
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int96_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int96_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_int96_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_int96_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int96_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":6635
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int128_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int128_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_int128_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_int128_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_int128_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":7238
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float32_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float32_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_float32_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_float32_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float32_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":7841
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float64_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float64_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_float64_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_float64_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float64_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":8444
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float80_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float80_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_float80_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_float80_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float80_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":9047
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float96_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float96_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_float96_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_float96_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float96_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":9650
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float128_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float128_t     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_float128_t __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_float128_t __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_float128_t __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":10253
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_object(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_object     __interpolate
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  __pyx_t_10redblackpy_6series_11tree_series_interpolate_object __pyx___interpolate;
  __pyx_t_10redblackpy_6series_11tree_series_itermode_search_object __pyx___get_item;
  __pyx_t_10redblackpy_6series_11tree_series_arithmetic_type_object __pyx___arithmetic;
  PyObject *name;
  PyObject *arithmetic;
  PyObject *interpolate_type;
  PyObject *extrapolate;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":95
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":308
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":698
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":911
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":1301
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":1514
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":1904
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":2117
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":2507
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":2720
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":3110
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":3323
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":3713
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":3926
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":4316
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":4529
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":4919
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":5132
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":5522
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":5735
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":6125
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":6338
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":6728
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":6941
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":7331
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":7544
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":7934
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":8147
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":8537
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":8750
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":9140
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":9353
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":9743
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":9956
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":10346
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};


/* "redblackpy/cython_source/tree_series_dtype.pxi":10559
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ {
  PyObject_HEAD
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_0;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_1;
};



/* "redblackpy/cython_source/base_tree_series.pxi":10
 * # Base class for series on trees
 * #--------------------------------------------------------------------------------------------
 * cdef class __BaseTreeSeries:             # <<<<<<<<<<<<<<
 * 
 * 
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries {
  int (*empty)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  PyObject *(*keys)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  PyObject *(*begin)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  PyObject *(*end)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  void (*on_itermode)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  void (*off_itermode)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr (*get_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *);
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr (*link)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *);
  PyObject *(*__pyx___get_key_from_ptr)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr);
  PyObject *(*__pyx___get_key_from_iter)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_iterator);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
static __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *);
static CYTHON_INLINE __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *);
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr);
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_iterator);


/* "redblackpy/series/tree_series.pyx":48
 * @cython.binding(True)
 * @cython.embedsignature(True)
 * cdef class Series:             # <<<<<<<<<<<<<<
 *     """
 *     Mapping data structure based on red-black trees. Provides fast queries:
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series {
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*begin)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  PyObject *(*end)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr (*get_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *);
  PyObject *(*index)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *(*uniform)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  void (*set_extrapolation)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  void (*on_itermode)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  void (*off_itermode)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
  void (*cast_dtype)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*to_pandas)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *__pyx_vtabptr_10redblackpy_6series_11tree_series_Series;


/* "redblackpy/cython_source/tree_series_dtype.pxi":2
 * @cython.internal
 * cdef class __TreeSeries_uint8_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint8_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":605
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint16_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint16_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":1208
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint32_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint32_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":1811
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint64_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint64_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":2414
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint96_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint96_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":3017
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_uint128_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_uint128_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":3620
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int8_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int8_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":4223
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int16_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int16_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":4826
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int32_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int32_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":5429
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int64_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int64_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":6032
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int96_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int96_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":6635
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_int128_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_int128_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":7238
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float32_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float32_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":7841
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float64_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float64_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":8444
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float80_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float80_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":9047
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float96_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float96_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":9650
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_float128_t(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_float128_t     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t;


/* "redblackpy/cython_source/tree_series_dtype.pxi":10253
 *         return result
 * @cython.internal
 * cdef class __TreeSeries_object(__BaseTreeSeries):             # <<<<<<<<<<<<<<
 * 
 *     cdef interpolate_object     __interpolate
 */

struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object {
  struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_base;
  void (*insert)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  void (*insert_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  void (*erase)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  void (*erase_range)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*values)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, int __pyx_skip_dispatch);
  PyObject *(*items)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, int __pyx_skip_dispatch);
  PyObject *(*floor)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  PyObject *(*ceil)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*truncate)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*periodic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*map)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map *__pyx_optional_args);
  void (*map_inplace)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace *__pyx_optional_args);
  void (*set_interpolation)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  void (*set_arithmetic)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  void (*copy_data)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data *__pyx_optional_args);
  void (*clear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*add)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*sub)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*mul)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*div)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*lshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*rshift)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch);
  void (*__pyx___init_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *);
  void (*__pyx___init_tree_index)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *);
  PyObject *(*__pyx___get_item_linear)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  PyObject *(*__pyx___get_item_tree)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx___get_item_slice)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx___lshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx___rshift_int)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, Py_ssize_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx___arithmetic_left)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx___arithmetic_union)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object);
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object;

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

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

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

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

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

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

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#endif

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

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

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

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

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

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

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

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

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

/* None.proto */
static CYTHON_INLINE int __Pyx_div_int(int, int);

/* UnaryNegOverflows.proto */
#define UNARY_NEG_WOULD_OVERFLOW(x)\
        (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))

/* None.proto */
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t);

/* None.proto */
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t);

/* None.proto */
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t);

/* None.proto */
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t);

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

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

/* ArgTypeTest.proto */
#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
    ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
        __Pyx__ArgTypeTest(obj, type, name, exact))
static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

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

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

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

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

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

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

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

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

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

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

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

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

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

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

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
#else
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
    PyObject_RichCompare(op1, op2, Py_EQ)
    #endif

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

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

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

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

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

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

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

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

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

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

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

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

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

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

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

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

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

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

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

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

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

/* CppExceptionConversion.proto */
#ifndef __Pyx_CppExn2PyErr
#include <new>
#include <typeinfo>
#include <stdexcept>
#include <ios>
static void __Pyx_CppExn2PyErr() {
  try {
    if (PyErr_Occurred())
      ; // let the latest Python exn pass through and ignore the current one
    else
      throw;
  } catch (const std::bad_alloc& exn) {
    PyErr_SetString(PyExc_MemoryError, exn.what());
  } catch (const std::bad_cast& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::bad_typeid& exn) {
    PyErr_SetString(PyExc_TypeError, exn.what());
  } catch (const std::domain_error& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::invalid_argument& exn) {
    PyErr_SetString(PyExc_ValueError, exn.what());
  } catch (const std::ios_base::failure& exn) {
    PyErr_SetString(PyExc_IOError, exn.what());
  } catch (const std::out_of_range& exn) {
    PyErr_SetString(PyExc_IndexError, exn.what());
  } catch (const std::overflow_error& exn) {
    PyErr_SetString(PyExc_OverflowError, exn.what());
  } catch (const std::range_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::underflow_error& exn) {
    PyErr_SetString(PyExc_ArithmeticError, exn.what());
  } catch (const std::exception& exn) {
    PyErr_SetString(PyExc_RuntimeError, exn.what());
  }
  catch (...)
  {
    PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
  }
}
#endif

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value);

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

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value);

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

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__char(signed char value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *);

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

/* CIntFromPy.proto */
static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *);

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

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

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

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

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

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

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

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

/* None.proto */
#include <new>

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

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

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

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

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

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

static int __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_empty(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_keys(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_begin(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_end(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_node); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, Py_ssize_t __pyx_v_shift_param); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object __pyx_v_action); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object __pyx_v_action); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_insert(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_erase(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_begin(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_end(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_index(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_f_10redblackpy_6series_11tree_series_6Series_get_tree(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_values(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_items(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_floor(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_f_10redblackpy_6series_11tree_series_6Series_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch); /* proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_f_10redblackpy_6series_11tree_series_6Series_uniform(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_map(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map *__pyx_optional_args); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_set_extrapolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_extrapolate, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_cast_dtype(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_dtype, int __pyx_skip_dispatch); /* proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_to_pandas(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/

/* Module declarations from 'libcpp' */

/* Module declarations from 'libc.string' */

/* Module declarations from 'libc.stdio' */

/* Module declarations from '__builtin__' */

/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;

/* Module declarations from 'cpython' */

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

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

/* Module declarations from 'libc.stdlib' */

/* Module declarations from 'libcpp.utility' */

/* Module declarations from 'libcpp.unordered_map' */

/* Module declarations from 'libcpp.string' */

/* Module declarations from 'libcpp.vector' */

/* Module declarations from 'redblackpy.tree_cython_api.types_mapping' */

/* Module declarations from 'redblackpy.tree_cython_api' */

/* Module declarations from 'libcpp.pair' */

/* Module declarations from 'redblackpy.tree_cython_api.tree' */

/* Module declarations from 'cython' */

/* Module declarations from 'redblackpy.series.tree_series' */
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series_Series = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems = 0;
static PyTypeObject *__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ = 0;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint8_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint16_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint32_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint64_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint96_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_uint128_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_int8_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_int16_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_int32_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_int64_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_int96_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_int128_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_float32_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_float64_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_float80_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_float96_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_float128_t>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t;
static std::unordered_map<std::string,__pyx_t_10redblackpy_6series_11tree_series_interpolate_object>  __pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object;
static CYTHON_INLINE __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(PyObject *); /*proto*/
static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &, __pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &); /*proto*/
static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &, __pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &); /*proto*/
static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_comp_pair(std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &, std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &); /*proto*/
static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_equal_pair(std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &, std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___add_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___div_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___add_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___div_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___add_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___div_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___add_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___div_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___add_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___div_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___add_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___div_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___add_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___sub_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___mul_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___div_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___add_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___sub_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___mul_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___div_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___add_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___sub_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___mul_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___div_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___add_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___sub_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___mul_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___div_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___add_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___sub_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___mul_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___div_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___add_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___sub_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___mul_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___div_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___add_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___sub_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___mul_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___div_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___add_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___sub_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___mul_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___div_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___add_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___sub_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___mul_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___div_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___add_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___sub_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___mul_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___div_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___add_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___sub_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___mul_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___div_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___add_object(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___sub_object(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___mul_object(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___div_object(PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float80_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float80_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float80_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t); /*proto*/
static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t); /*proto*/
static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_object(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *, PyObject *); /*proto*/
static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_object(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &, PyObject *, PyObject *); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_object(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &, PyObject *); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series___set_value_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr, PyObject *); /*proto*/
static std::string __pyx_convert_string_from_py_std__in_string(PyObject *); /*proto*/
#define __Pyx_MODULE_NAME "redblackpy.series.tree_series"
extern int __pyx_module_is_main_redblackpy__series__tree_series;
int __pyx_module_is_main_redblackpy__series__tree_series = 0;

/* Implementation of 'redblackpy.series.tree_series' */
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_staticmethod;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_ValueError;
static const char __pyx_k_nn[] = "nn";
static const char __pyx_k_pd[] = "pd";
static const char __pyx_k__10[] = "\n";
static const char __pyx_k__11[] = "...\n";
static const char __pyx_k_add[] = "add";
static const char __pyx_k_del[] = "__del__";
static const char __pyx_k_div[] = "div";
static const char __pyx_k_end[] = "end";
static const char __pyx_k_key[] = "key";
static const char __pyx_k_len[] = "__len__";
static const char __pyx_k_map[] = "map";
static const char __pyx_k_mul[] = "mul";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_pop[] = "pop";
static const char __pyx_k_str[] = "str";
static const char __pyx_k_sub[] = "sub";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_data[] = "data";
static const char __pyx_k_int8[] = "int8";
static const char __pyx_k_iter[] = "__iter__";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_left[] = "left";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_name[] = "name";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_utf8[] = "utf8";
static const char __pyx_k_begin[] = "begin";
static const char __pyx_k_class[] = "__class__";
static const char __pyx_k_clear[] = "clear";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_dtype[] = "dtype";
static const char __pyx_k_empty[] = "empty";
static const char __pyx_k_erase[] = "erase";
static const char __pyx_k_error[] = "error";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_int16[] = "int16";
static const char __pyx_k_int32[] = "int32";
static const char __pyx_k_int64[] = "int64";
static const char __pyx_k_int96[] = "int96";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_other[] = "other";
static const char __pyx_k_pairs[] = "pairs";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_str_2[] = "__str__";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_uint8[] = "uint8";
static const char __pyx_k_union[] = "union";
static const char __pyx_k_value[] = "value";
static const char __pyx_k_Series[] = "Series";
static const char __pyx_k_format[] = "format";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_insert[] = "insert";
static const char __pyx_k_int128[] = "int128";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_linear[] = "linear";
static const char __pyx_k_lshift[] = "lshift";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_name_2[] = "__name__";
static const char __pyx_k_object[] = "object";
static const char __pyx_k_pandas[] = "pandas";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_rshift[] = "rshift";
static const char __pyx_k_uint16[] = "uint16";
static const char __pyx_k_uint32[] = "uint32";
static const char __pyx_k_uint64[] = "uint64";
static const char __pyx_k_uint96[] = "uint96";
static const char __pyx_k_values[] = "values";
static const char __pyx_k_float32[] = "float32";
static const char __pyx_k_float64[] = "float64";
static const char __pyx_k_float80[] = "float80";
static const char __pyx_k_float96[] = "float96";
static const char __pyx_k_forward[] = "forward";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_inplace[] = "inplace";
static const char __pyx_k_setitem[] = "__setitem__";
static const char __pyx_k_to_type[] = "to_type";
static const char __pyx_k_uint128[] = "uint128";
static const char __pyx_k_uniform[] = "uniform";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_Untitled[] = "Untitled";
static const char __pyx_k_contains[] = "__contains__";
static const char __pyx_k_float128[] = "float128";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_periodic[] = "periodic";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_truncate[] = "truncate";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_copy_data[] = "copy_data";
static const char __pyx_k_iteritems[] = "iteritems";
static const char __pyx_k_key_value[] = "{key}: {value}\n";
static const char __pyx_k_numerical[] = "numerical";
static const char __pyx_k_pd_series[] = "pd_series";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_to_pandas[] = "to_pandas";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Series_end[] = "Series.end";
static const char __pyx_k_Series_map[] = "Series.map";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_arithmetic[] = "arithmetic";
static const char __pyx_k_cast_dtype[] = "cast_dtype";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_Series_ceil[] = "Series.ceil";
static const char __pyx_k_erase_range[] = "erase_range";
static const char __pyx_k_extrapolate[] = "extrapolate";
static const char __pyx_k_from_pandas[] = "from_pandas";
static const char __pyx_k_interpolate[] = "interpolate";
static const char __pyx_k_map_inplace[] = "map_inplace";
static const char __pyx_k_on_itermode[] = "on_itermode";
static const char __pyx_k_Series___del[] = "Series.__del__";
static const char __pyx_k_Series_begin[] = "Series.begin";
static const char __pyx_k_Series_erase[] = "Series.erase";
static const char __pyx_k_Series_floor[] = "Series.floor";
static const char __pyx_k_Series_index[] = "Series.index";
static const char __pyx_k_Series_items[] = "Series.items";
static const char __pyx_k_insert_range[] = "insert_range";
static const char __pyx_k_off_itermode[] = "off_itermode";
static const char __pyx_k_staticmethod[] = "staticmethod";
static const char __pyx_k_Series_insert[] = "Series.insert";
static const char __pyx_k_Series_object[] = "Series object ";
static const char __pyx_k_Series_values[] = "Series.values";
static const char __pyx_k_extrapolation[] = "extrapolation";
static const char __pyx_k_interpolation[] = "interpolation";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_Index_is_empty[] = "Index is empty.";
static const char __pyx_k_Series_uniform[] = "Series.uniform";
static const char __pyx_k_set_arithmetic[] = "set_arithmetic";
static const char __pyx_k_Series___reduce[] = "Series.__reduce__";
static const char __pyx_k_Series_truncate[] = "Series.truncate";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_Series_iteritems[] = "Series.iteritems";
static const char __pyx_k_Series_to_pandas[] = "Series.to_pandas";
static const char __pyx_k_interpolate_type[] = "interpolate_type";
static const char __pyx_k_Series___getstate[] = "Series.__getstate__";
static const char __pyx_k_Series___setstate[] = "Series.__setstate__";
static const char __pyx_k_Series_cast_dtype[] = "Series.cast_dtype";
static const char __pyx_k_set_extrapolation[] = "set_extrapolation";
static const char __pyx_k_set_interpolation[] = "set_interpolation";
static const char __pyx_k_Series_from_pandas[] = "Series.from_pandas";
static const char __pyx_k_Series_on_itermode[] = "Series.on_itermode";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_Series_insert_range[] = "Series.insert_range";
static const char __pyx_k_Series_off_itermode[] = "Series.off_itermode";
static const char __pyx_k_Inconsistent_key_type[] = "Inconsistent key type: ";
static const char __pyx_k_Series_set_arithmetic[] = "Series.set_arithmetic";
static const char __pyx_k_Unsupported_data_type[] = "Unsupported data type {:}";
static const char __pyx_k_Series_set_extrapolation[] = "Series.set_extrapolation";
static const char __pyx_k_Series_set_interpolation[] = "Series.set_interpolation";
static const char __pyx_k_TreeSeries_int8_t___iter[] = "__TreeSeries_int8_t.__iter__";
static const char __pyx_k_TreeSeries_object___iter[] = "__TreeSeries_object.__iter__";
static const char __pyx_k_TreeSeries_int16_t___iter[] = "__TreeSeries_int16_t.__iter__";
static const char __pyx_k_TreeSeries_int32_t___iter[] = "__TreeSeries_int32_t.__iter__";
static const char __pyx_k_TreeSeries_int64_t___iter[] = "__TreeSeries_int64_t.__iter__";
static const char __pyx_k_TreeSeries_int96_t___iter[] = "__TreeSeries_int96_t.__iter__";
static const char __pyx_k_TreeSeries_uint8_t___iter[] = "__TreeSeries_uint8_t.__iter__";
static const char __pyx_k_TreeSeries_int128_t___iter[] = "__TreeSeries_int128_t.__iter__";
static const char __pyx_k_TreeSeries_uint16_t___iter[] = "__TreeSeries_uint16_t.__iter__";
static const char __pyx_k_TreeSeries_uint32_t___iter[] = "__TreeSeries_uint32_t.__iter__";
static const char __pyx_k_TreeSeries_uint64_t___iter[] = "__TreeSeries_uint64_t.__iter__";
static const char __pyx_k_TreeSeries_uint96_t___iter[] = "__TreeSeries_uint96_t.__iter__";
static const char __pyx_k_TreeSeries_float32_t___iter[] = "__TreeSeries_float32_t.__iter__";
static const char __pyx_k_TreeSeries_float64_t___iter[] = "__TreeSeries_float64_t.__iter__";
static const char __pyx_k_TreeSeries_float80_t___iter[] = "__TreeSeries_float80_t.__iter__";
static const char __pyx_k_TreeSeries_float96_t___iter[] = "__TreeSeries_float96_t.__iter__";
static const char __pyx_k_TreeSeries_int8_t_iteritems[] = "__TreeSeries_int8_t.iteritems";
static const char __pyx_k_TreeSeries_object_iteritems[] = "__TreeSeries_object.iteritems";
static const char __pyx_k_TreeSeries_uint128_t___iter[] = "__TreeSeries_uint128_t.__iter__";
static const char __pyx_k_TreeSeries_float128_t___iter[] = "__TreeSeries_float128_t.__iter__";
static const char __pyx_k_TreeSeries_int16_t_iteritems[] = "__TreeSeries_int16_t.iteritems";
static const char __pyx_k_TreeSeries_int32_t_iteritems[] = "__TreeSeries_int32_t.iteritems";
static const char __pyx_k_TreeSeries_int64_t_iteritems[] = "__TreeSeries_int64_t.iteritems";
static const char __pyx_k_TreeSeries_int96_t_iteritems[] = "__TreeSeries_int96_t.iteritems";
static const char __pyx_k_TreeSeries_uint8_t_iteritems[] = "__TreeSeries_uint8_t.iteritems";
static const char __pyx_k_TreeSeries_int128_t_iteritems[] = "__TreeSeries_int128_t.iteritems";
static const char __pyx_k_TreeSeries_uint16_t_iteritems[] = "__TreeSeries_uint16_t.iteritems";
static const char __pyx_k_TreeSeries_uint32_t_iteritems[] = "__TreeSeries_uint32_t.iteritems";
static const char __pyx_k_TreeSeries_uint64_t_iteritems[] = "__TreeSeries_uint64_t.iteritems";
static const char __pyx_k_TreeSeries_uint96_t_iteritems[] = "__TreeSeries_uint96_t.iteritems";
static const char __pyx_k_redblackpy_series_tree_series[] = "redblackpy.series.tree_series";
static const char __pyx_k_TreeSeries_float128_t_iteritem[] = "__TreeSeries_float128_t.iteritems";
static const char __pyx_k_TreeSeries_float32_t_iteritems[] = "__TreeSeries_float32_t.iteritems";
static const char __pyx_k_TreeSeries_float64_t_iteritems[] = "__TreeSeries_float64_t.iteritems";
static const char __pyx_k_TreeSeries_float80_t_iteritems[] = "__TreeSeries_float80_t.iteritems";
static const char __pyx_k_TreeSeries_float96_t_iteritems[] = "__TreeSeries_float96_t.iteritems";
static const char __pyx_k_TreeSeries_uint128_t_iteritems[] = "__TreeSeries_uint128_t.iteritems";
static const char __pyx_k_Index_must_have_the_same_length[] = "Index must have the same length as values.";
static const char __pyx_k_Index_cannot_be_None_while_value[] = "Index cannot be None while values are not.";
static const char __pyx_k_Shift_parameter_must_be_more_tha[] = "Shift parameter must be more than zero.";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static const char __pyx_k_redblackpy_series_tree_series_py[] = "redblackpy/series/tree_series.pyx";
static PyObject *__pyx_kp_s_Inconsistent_key_type;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_kp_s_Index_cannot_be_None_while_value;
static PyObject *__pyx_kp_s_Index_is_empty;
static PyObject *__pyx_kp_s_Index_must_have_the_same_length;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_Series;
static PyObject *__pyx_n_s_Series___del;
static PyObject *__pyx_n_s_Series___getstate;
static PyObject *__pyx_n_s_Series___reduce;
static PyObject *__pyx_n_s_Series___setstate;
static PyObject *__pyx_n_s_Series_begin;
static PyObject *__pyx_n_s_Series_cast_dtype;
static PyObject *__pyx_n_s_Series_ceil;
static PyObject *__pyx_n_s_Series_end;
static PyObject *__pyx_n_s_Series_erase;
static PyObject *__pyx_n_s_Series_floor;
static PyObject *__pyx_n_s_Series_from_pandas;
static PyObject *__pyx_n_s_Series_index;
static PyObject *__pyx_n_s_Series_insert;
static PyObject *__pyx_n_s_Series_insert_range;
static PyObject *__pyx_n_s_Series_items;
static PyObject *__pyx_n_s_Series_iteritems;
static PyObject *__pyx_n_s_Series_map;
static PyObject *__pyx_kp_s_Series_object;
static PyObject *__pyx_n_s_Series_off_itermode;
static PyObject *__pyx_n_s_Series_on_itermode;
static PyObject *__pyx_n_s_Series_set_arithmetic;
static PyObject *__pyx_n_s_Series_set_extrapolation;
static PyObject *__pyx_n_s_Series_set_interpolation;
static PyObject *__pyx_n_s_Series_to_pandas;
static PyObject *__pyx_n_s_Series_truncate;
static PyObject *__pyx_n_s_Series_uniform;
static PyObject *__pyx_n_s_Series_values;
static PyObject *__pyx_kp_s_Shift_parameter_must_be_more_tha;
static PyObject *__pyx_n_s_TreeSeries_float128_t___iter;
static PyObject *__pyx_n_s_TreeSeries_float128_t_iteritem;
static PyObject *__pyx_n_s_TreeSeries_float32_t___iter;
static PyObject *__pyx_n_s_TreeSeries_float32_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_float64_t___iter;
static PyObject *__pyx_n_s_TreeSeries_float64_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_float80_t___iter;
static PyObject *__pyx_n_s_TreeSeries_float80_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_float96_t___iter;
static PyObject *__pyx_n_s_TreeSeries_float96_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_int128_t___iter;
static PyObject *__pyx_n_s_TreeSeries_int128_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_int16_t___iter;
static PyObject *__pyx_n_s_TreeSeries_int16_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_int32_t___iter;
static PyObject *__pyx_n_s_TreeSeries_int32_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_int64_t___iter;
static PyObject *__pyx_n_s_TreeSeries_int64_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_int8_t___iter;
static PyObject *__pyx_n_s_TreeSeries_int8_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_int96_t___iter;
static PyObject *__pyx_n_s_TreeSeries_int96_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_object___iter;
static PyObject *__pyx_n_s_TreeSeries_object_iteritems;
static PyObject *__pyx_n_s_TreeSeries_uint128_t___iter;
static PyObject *__pyx_n_s_TreeSeries_uint128_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_uint16_t___iter;
static PyObject *__pyx_n_s_TreeSeries_uint16_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_uint32_t___iter;
static PyObject *__pyx_n_s_TreeSeries_uint32_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_uint64_t___iter;
static PyObject *__pyx_n_s_TreeSeries_uint64_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_uint8_t___iter;
static PyObject *__pyx_n_s_TreeSeries_uint8_t_iteritems;
static PyObject *__pyx_n_s_TreeSeries_uint96_t___iter;
static PyObject *__pyx_n_s_TreeSeries_uint96_t_iteritems;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_kp_s_Unsupported_data_type;
static PyObject *__pyx_n_s_Untitled;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s__10;
static PyObject *__pyx_kp_s__11;
static PyObject *__pyx_n_s_add;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_arithmetic;
static PyObject *__pyx_n_s_begin;
static PyObject *__pyx_n_s_cast_dtype;
static PyObject *__pyx_n_b_ceil;
static PyObject *__pyx_n_s_ceil;
static PyObject *__pyx_n_s_class;
static PyObject *__pyx_n_s_clear;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_contains;
static PyObject *__pyx_n_s_copy_data;
static PyObject *__pyx_n_s_data;
static PyObject *__pyx_n_s_del;
static PyObject *__pyx_n_s_div;
static PyObject *__pyx_n_s_dtype;
static PyObject *__pyx_n_s_empty;
static PyObject *__pyx_n_s_end;
static PyObject *__pyx_n_s_erase;
static PyObject *__pyx_n_s_erase_range;
static PyObject *__pyx_n_b_error;
static PyObject *__pyx_n_s_extrapolate;
static PyObject *__pyx_n_s_extrapolation;
static PyObject *__pyx_n_s_float128;
static PyObject *__pyx_n_s_float32;
static PyObject *__pyx_n_s_float64;
static PyObject *__pyx_n_s_float80;
static PyObject *__pyx_n_s_float96;
static PyObject *__pyx_n_b_floor;
static PyObject *__pyx_n_s_floor;
static PyObject *__pyx_n_s_format;
static PyObject *__pyx_n_b_forward;
static PyObject *__pyx_n_s_from_pandas;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_inplace;
static PyObject *__pyx_n_s_insert;
static PyObject *__pyx_n_s_insert_range;
static PyObject *__pyx_n_s_int128;
static PyObject *__pyx_n_s_int16;
static PyObject *__pyx_n_s_int32;
static PyObject *__pyx_n_s_int64;
static PyObject *__pyx_n_s_int8;
static PyObject *__pyx_n_s_int96;
static PyObject *__pyx_n_s_interpolate;
static PyObject *__pyx_n_s_interpolate_type;
static PyObject *__pyx_n_s_interpolation;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_iter;
static PyObject *__pyx_n_s_iteritems;
static PyObject *__pyx_n_s_key;
static PyObject *__pyx_kp_s_key_value;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_left;
static PyObject *__pyx_n_s_len;
static PyObject *__pyx_n_b_linear;
static PyObject *__pyx_n_s_lshift;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_map;
static PyObject *__pyx_n_s_map_inplace;
static PyObject *__pyx_n_s_method;
static PyObject *__pyx_n_s_mul;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_name_2;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_b_nn;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_numerical;
static PyObject *__pyx_n_s_object;
static PyObject *__pyx_n_s_off_itermode;
static PyObject *__pyx_n_s_on_itermode;
static PyObject *__pyx_n_s_other;
static PyObject *__pyx_n_s_pairs;
static PyObject *__pyx_n_s_pandas;
static PyObject *__pyx_n_s_pd;
static PyObject *__pyx_n_s_pd_series;
static PyObject *__pyx_n_s_periodic;
static PyObject *__pyx_n_s_pop;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_redblackpy_series_tree_series;
static PyObject *__pyx_kp_s_redblackpy_series_tree_series_py;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_rshift;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_set_arithmetic;
static PyObject *__pyx_n_s_set_extrapolation;
static PyObject *__pyx_n_s_set_interpolation;
static PyObject *__pyx_n_s_setitem;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_staticmethod;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_str;
static PyObject *__pyx_n_s_str_2;
static PyObject *__pyx_n_s_sub;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_to_pandas;
static PyObject *__pyx_n_s_to_type;
static PyObject *__pyx_n_s_truncate;
static PyObject *__pyx_n_s_uint128;
static PyObject *__pyx_n_s_uint16;
static PyObject *__pyx_n_s_uint32;
static PyObject *__pyx_n_s_uint64;
static PyObject *__pyx_n_s_uint8;
static PyObject *__pyx_n_s_uint96;
static PyObject *__pyx_n_s_uniform;
static PyObject *__pyx_n_s_union;
static PyObject *__pyx_n_s_utf8;
static PyObject *__pyx_n_s_value;
static PyObject *__pyx_n_s_values;
static PyObject *__pyx_n_s_zip;
static int __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_4empty(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_6keys(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_8begin(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_10end(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_12on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_14off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_16__len__(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_18__contains__(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_keys); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static void __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series___init__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_dtype, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_13interpolation___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_13interpolation_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_interpolation); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_13extrapolation___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_13extrapolation_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_extrapolation); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_2insert(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_4insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_pairs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_6erase(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_8begin(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_10end(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_12index(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_14values(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_16items(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_18iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_20floor(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_22ceil(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_24truncate(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_26uniform(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_28map(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_v_inplace, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_30set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_interpolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_32set_extrapolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_extrapolate); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_34set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_36on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_38off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_40cast_dtype(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_dtype); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_42to_pandas(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_44from_pandas(PyObject *__pyx_v_pd_series, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_extrapolate, PyObject *__pyx_v_arithmetic); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_46__del__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static Py_ssize_t __pyx_pf_10redblackpy_6series_11tree_series_6Series_48__len__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_50__str__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_52__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_54__contains__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_56__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_58__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_60__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_62__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_64__sub__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_66__mul__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_68__div__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other); /* proto */
#endif
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_70__truediv__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_72__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_74__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_76__reduce__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_78__getstate__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_80__setstate__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_state); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_5dtype___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self); /* proto */
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series_Series(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_3735928559;
static PyObject *__pyx_k__8;
static PyObject *__pyx_k__9;
static PyObject *__pyx_k__20;
static PyObject *__pyx_k__21;
static PyObject *__pyx_k__30;
static PyObject *__pyx_k__31;
static PyObject *__pyx_k__40;
static PyObject *__pyx_k__41;
static PyObject *__pyx_k__50;
static PyObject *__pyx_k__51;
static PyObject *__pyx_k__60;
static PyObject *__pyx_k__61;
static PyObject *__pyx_k__70;
static PyObject *__pyx_k__71;
static PyObject *__pyx_k__80;
static PyObject *__pyx_k__81;
static PyObject *__pyx_k__90;
static PyObject *__pyx_k__91;
static PyObject *__pyx_k__100;
static PyObject *__pyx_k__101;
static PyObject *__pyx_k__110;
static PyObject *__pyx_k__111;
static PyObject *__pyx_k__120;
static PyObject *__pyx_k__121;
static PyObject *__pyx_k__130;
static PyObject *__pyx_k__131;
static PyObject *__pyx_k__140;
static PyObject *__pyx_k__141;
static PyObject *__pyx_k__150;
static PyObject *__pyx_k__151;
static PyObject *__pyx_k__160;
static PyObject *__pyx_k__161;
static PyObject *__pyx_k__170;
static PyObject *__pyx_k__171;
static PyObject *__pyx_k__180;
static PyObject *__pyx_k__181;
static PyObject *__pyx_k__187;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__142;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__144;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__146;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__148;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__152;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__154;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__156;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__158;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__162;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__164;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__166;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__168;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__172;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__174;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__176;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__178;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__182;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__184;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__186;
static PyObject *__pyx_tuple__188;
static PyObject *__pyx_tuple__190;
static PyObject *__pyx_tuple__192;
static PyObject *__pyx_tuple__194;
static PyObject *__pyx_tuple__196;
static PyObject *__pyx_tuple__198;
static PyObject *__pyx_tuple__200;
static PyObject *__pyx_tuple__202;
static PyObject *__pyx_tuple__204;
static PyObject *__pyx_tuple__206;
static PyObject *__pyx_tuple__208;
static PyObject *__pyx_tuple__210;
static PyObject *__pyx_tuple__212;
static PyObject *__pyx_tuple__214;
static PyObject *__pyx_tuple__216;
static PyObject *__pyx_tuple__218;
static PyObject *__pyx_tuple__220;
static PyObject *__pyx_tuple__222;
static PyObject *__pyx_tuple__224;
static PyObject *__pyx_tuple__226;
static PyObject *__pyx_tuple__228;
static PyObject *__pyx_tuple__230;
static PyObject *__pyx_tuple__232;
static PyObject *__pyx_tuple__234;
static PyObject *__pyx_tuple__236;
static PyObject *__pyx_tuple__238;
static PyObject *__pyx_codeobj__189;
static PyObject *__pyx_codeobj__191;
static PyObject *__pyx_codeobj__193;
static PyObject *__pyx_codeobj__195;
static PyObject *__pyx_codeobj__197;
static PyObject *__pyx_codeobj__199;
static PyObject *__pyx_codeobj__201;
static PyObject *__pyx_codeobj__203;
static PyObject *__pyx_codeobj__205;
static PyObject *__pyx_codeobj__207;
static PyObject *__pyx_codeobj__209;
static PyObject *__pyx_codeobj__211;
static PyObject *__pyx_codeobj__213;
static PyObject *__pyx_codeobj__215;
static PyObject *__pyx_codeobj__217;
static PyObject *__pyx_codeobj__219;
static PyObject *__pyx_codeobj__221;
static PyObject *__pyx_codeobj__223;
static PyObject *__pyx_codeobj__225;
static PyObject *__pyx_codeobj__227;
static PyObject *__pyx_codeobj__229;
static PyObject *__pyx_codeobj__231;
static PyObject *__pyx_codeobj__233;
static PyObject *__pyx_codeobj__235;
static PyObject *__pyx_codeobj__237;
static PyObject *__pyx_codeobj__239;
/* Late includes */

/* "redblackpy/cython_source/c_pyobject.pxi":16
 * 
 * # Construct c_pyobject
 * cdef inline c_pyobject to_c_pyobject(object obj):             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject result = c_pyobject(<PyObject*>(obj))
 */

static CYTHON_INLINE __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(PyObject *__pyx_v_obj) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_result;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  __Pyx_RefNannySetupContext("to_c_pyobject", 0);

  /* "redblackpy/cython_source/c_pyobject.pxi":18
 * cdef inline c_pyobject to_c_pyobject(object obj):
 * 
 *     cdef c_pyobject result = c_pyobject(<PyObject*>(obj))             # <<<<<<<<<<<<<<
 *     # Increment refernce counter to garbage collector will not free memory.
 *     Py_XINCREF(result.data)
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_obj);
  __pyx_v_result = __pyx_t_1;

  /* "redblackpy/cython_source/c_pyobject.pxi":20
 *     cdef c_pyobject result = c_pyobject(<PyObject*>(obj))
 *     # Increment refernce counter to garbage collector will not free memory.
 *     Py_XINCREF(result.data)             # <<<<<<<<<<<<<<
 * 
 *     return result
 */
  Py_XINCREF(__pyx_v_result.data);

  /* "redblackpy/cython_source/c_pyobject.pxi":22
 *     Py_XINCREF(result.data)
 * 
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/c_pyobject.pxi":16
 * 
 * # Construct c_pyobject
 * cdef inline c_pyobject to_c_pyobject(object obj):             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject result = c_pyobject(<PyObject*>(obj))
 */

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

/* "redblackpy/cython_source/c_pyobject.pxi":27
 * # Comparators for c_pyobject. Needs casting to Python objects for comparison.
 * # Objects have to provides builtin comparison operators.
 * cdef inline int compare_func(const c_pyobject& a_1, const c_pyobject& a_2) with gil:             # <<<<<<<<<<<<<<
 * 
 *     return PyObject_RichCompareBool(a_1.data, a_2.data, Py_LT)
 */

static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &__pyx_v_a_1, __pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &__pyx_v_a_2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("compare_func", 0);

  /* "redblackpy/cython_source/c_pyobject.pxi":29
 * cdef inline int compare_func(const c_pyobject& a_1, const c_pyobject& a_2) with gil:
 * 
 *     return PyObject_RichCompareBool(a_1.data, a_2.data, Py_LT)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_RichCompareBool(__pyx_v_a_1.data, __pyx_v_a_2.data, Py_LT);
  goto __pyx_L0;

  /* "redblackpy/cython_source/c_pyobject.pxi":27
 * # Comparators for c_pyobject. Needs casting to Python objects for comparison.
 * # Objects have to provides builtin comparison operators.
 * cdef inline int compare_func(const c_pyobject& a_1, const c_pyobject& a_2) with gil:             # <<<<<<<<<<<<<<
 * 
 *     return PyObject_RichCompareBool(a_1.data, a_2.data, Py_LT)
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "redblackpy/cython_source/c_pyobject.pxi":32
 * 
 * 
 * cdef inline int equal(const c_pyobject& a_1, const c_pyobject& a_2) with gil:             # <<<<<<<<<<<<<<
 * 
 *     return PyObject_RichCompareBool(a_1.data, a_2.data, Py_EQ)
 */

static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &__pyx_v_a_1, __pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &__pyx_v_a_2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("equal", 0);

  /* "redblackpy/cython_source/c_pyobject.pxi":34
 * cdef inline int equal(const c_pyobject& a_1, const c_pyobject& a_2) with gil:
 * 
 *     return PyObject_RichCompareBool(a_1.data, a_2.data, Py_EQ)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = PyObject_RichCompareBool(__pyx_v_a_1.data, __pyx_v_a_2.data, Py_EQ);
  goto __pyx_L0;

  /* "redblackpy/cython_source/c_pyobject.pxi":32
 * 
 * 
 * cdef inline int equal(const c_pyobject& a_1, const c_pyobject& a_2) with gil:             # <<<<<<<<<<<<<<
 * 
 *     return PyObject_RichCompareBool(a_1.data, a_2.data, Py_EQ)
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "redblackpy/cython_source/c_pyobject.pxi":37
 * 
 * 
 * cdef inline int comp_pair( const pair[rb_tree_ptr, iterator]& a_1,             # <<<<<<<<<<<<<<
 *                            const pair[rb_tree_ptr, iterator]& a_2 ) with gil:
 * 
 */

static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_comp_pair(std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &__pyx_v_a_1, std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &__pyx_v_a_2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("comp_pair", 0);

  /* "redblackpy/cython_source/c_pyobject.pxi":40
 *                            const pair[rb_tree_ptr, iterator]& a_2 ) with gil:
 * 
 *     return compare_func( deref( deref(a_1.second) ).key,             # <<<<<<<<<<<<<<
 *                          deref( deref(a_2.second) ).key )
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series_compare_func((*(*__pyx_v_a_1.second)).key, (*(*__pyx_v_a_2.second)).key);
  goto __pyx_L0;

  /* "redblackpy/cython_source/c_pyobject.pxi":37
 * 
 * 
 * cdef inline int comp_pair( const pair[rb_tree_ptr, iterator]& a_1,             # <<<<<<<<<<<<<<
 *                            const pair[rb_tree_ptr, iterator]& a_2 ) with gil:
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "redblackpy/cython_source/c_pyobject.pxi":44
 * 
 * 
 * cdef inline int equal_pair( const pair[rb_tree_ptr, iterator]& a_1,             # <<<<<<<<<<<<<<
 *                             const pair[rb_tree_ptr, iterator]& a_2 ) with gil:
 * 
 */

static CYTHON_INLINE int __pyx_f_10redblackpy_6series_11tree_series_equal_pair(std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &__pyx_v_a_1, std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &__pyx_v_a_2) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  #ifdef WITH_THREAD
  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
  #endif
  __Pyx_RefNannySetupContext("equal_pair", 0);

  /* "redblackpy/cython_source/c_pyobject.pxi":47
 *                             const pair[rb_tree_ptr, iterator]& a_2 ) with gil:
 * 
 *     return equal( deref( deref(a_1.second) ).key,             # <<<<<<<<<<<<<<
 *                   deref( deref(a_2.second) ).key )
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series_equal((*(*__pyx_v_a_1.second)).key, (*(*__pyx_v_a_2.second)).key);
  goto __pyx_L0;

  /* "redblackpy/cython_source/c_pyobject.pxi":44
 * 
 * 
 * cdef inline int equal_pair( const pair[rb_tree_ptr, iterator]& a_1,             # <<<<<<<<<<<<<<
 *                             const pair[rb_tree_ptr, iterator]& a_2 ) with gil:
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #ifdef WITH_THREAD
  __Pyx_PyGILState_Release(__pyx_gilstate_save);
  #endif
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":13
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/base_tree_series.pxi":17
 * 
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 * 
 *         self.__index = new rb_tree()
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":19
 *     def __cinit__(self):
 * 
 *         self.__index = new rb_tree()             # <<<<<<<<<<<<<<
 *         self.__index.set_compare(compare_func)
 *         self.__index.set_equal(equal)
 */
  __pyx_v_self->__pyx___index = new __pyx_t_10redblackpy_6series_11tree_series_rb_tree();

  /* "redblackpy/cython_source/base_tree_series.pxi":20
 * 
 *         self.__index = new rb_tree()
 *         self.__index.set_compare(compare_func)             # <<<<<<<<<<<<<<
 *         self.__index.set_equal(equal)
 *         self.__iter_mode = False
 */
  __pyx_v_self->__pyx___index->set_compare(__pyx_f_10redblackpy_6series_11tree_series_compare_func);

  /* "redblackpy/cython_source/base_tree_series.pxi":21
 *         self.__index = new rb_tree()
 *         self.__index.set_compare(compare_func)
 *         self.__index.set_equal(equal)             # <<<<<<<<<<<<<<
 *         self.__iter_mode = False
 *         self.__last_call = deref( self.__index.begin() )
 */
  __pyx_v_self->__pyx___index->set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal);

  /* "redblackpy/cython_source/base_tree_series.pxi":22
 *         self.__index.set_compare(compare_func)
 *         self.__index.set_equal(equal)
 *         self.__iter_mode = False             # <<<<<<<<<<<<<<
 *         self.__last_call = deref( self.__index.begin() )
 * 
 */
  __pyx_v_self->__pyx___iter_mode = 0;

  /* "redblackpy/cython_source/base_tree_series.pxi":23
 *         self.__index.set_equal(equal)
 *         self.__iter_mode = False
 *         self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___last_call = (*__pyx_v_self->__pyx___index->begin());

  /* "redblackpy/cython_source/base_tree_series.pxi":17
 * 
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 * 
 *         self.__index = new rb_tree()
 */

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

/* "redblackpy/cython_source/base_tree_series.pxi":26
 * 
 * 
 *     cpdef bint empty(self):             # <<<<<<<<<<<<<<
 * 
 *         return (self.__index.size() == 0)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_5empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static int __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_empty(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch) {
  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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("empty", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_empty); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_5empty)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 26, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 26, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 26, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_r = __pyx_t_5;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":28
 *     cpdef bint empty(self):
 * 
 *         return (self.__index.size() == 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_self->__pyx___index->size() == 0);
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":26
 * 
 * 
 *     cpdef bint empty(self):             # <<<<<<<<<<<<<<
 * 
 *         return (self.__index.size() == 0)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__BaseTreeSeries.empty", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_5empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_5empty(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("empty (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_4empty(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_4empty(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("empty", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_empty(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 26, __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("redblackpy.series.tree_series.__BaseTreeSeries.empty", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":31
 * 
 * 
 *     cpdef list keys(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_7keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_keys(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("keys", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_keys); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 31, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_7keys)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 31, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 31, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(2, 31, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":34
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/base_tree_series.pxi":36
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( self.__get_key_from_ptr(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/base_tree_series.pxi":37
 * 
 *         for it in deref(self.__index):
 *             result.append( self.__get_key_from_ptr(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(__pyx_v_self, __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 37, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(2, 37, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/base_tree_series.pxi":36
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( self.__get_key_from_ptr(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":39
 *             result.append( self.__get_key_from_ptr(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":31
 * 
 * 
 *     cpdef list keys(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__BaseTreeSeries.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_7keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_7keys(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keys (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_6keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_6keys(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("keys", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_keys(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 31, __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("redblackpy.series.tree_series.__BaseTreeSeries.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":42
 * 
 * 
 *     cpdef begin(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_9begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_begin(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("begin", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 42, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_9begin)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 42, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":44
 *     cpdef begin(self):
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Index is empty.")
 * 
 */
  __pyx_t_5 = ((__pyx_v_self->__pyx___index->size() == 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "redblackpy/cython_source/base_tree_series.pxi":45
 * 
 *         if self.__index.size() == 0:
 *             raise IndexError("Index is empty.")             # <<<<<<<<<<<<<<
 * 
 *         return self.__get_key_from_iter( self.__index.begin() )
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 45, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 45, __pyx_L1_error)

    /* "redblackpy/cython_source/base_tree_series.pxi":44
 *     cpdef begin(self):
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Index is empty.")
 * 
 */
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":47
 *             raise IndexError("Index is empty.")
 * 
 *         return self.__get_key_from_iter( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(__pyx_v_self, __pyx_v_self->__pyx___index->begin()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 47, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":42
 * 
 * 
 *     cpdef begin(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__BaseTreeSeries.begin", __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_10redblackpy_6series_11tree_series_16__BaseTreeSeries_9begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_9begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("begin (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_8begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_8begin(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("begin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_begin(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 42, __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("redblackpy.series.tree_series.__BaseTreeSeries.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":50
 * 
 * 
 *     cpdef end(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_11end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_end(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("end", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 50, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_11end)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 50, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 50, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":52
 *     cpdef end(self):
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Index is empty.")
 * 
 */
  __pyx_t_5 = ((__pyx_v_self->__pyx___index->size() == 0) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "redblackpy/cython_source/base_tree_series.pxi":53
 * 
 *         if self.__index.size() == 0:
 *             raise IndexError("Index is empty.")             # <<<<<<<<<<<<<<
 * 
 *         return self.__get_key_from_iter( self.__index.back() )
 */
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 53, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_Raise(__pyx_t_1, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __PYX_ERR(2, 53, __pyx_L1_error)

    /* "redblackpy/cython_source/base_tree_series.pxi":52
 *     cpdef end(self):
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             raise IndexError("Index is empty.")
 * 
 */
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":55
 *             raise IndexError("Index is empty.")
 * 
 *         return self.__get_key_from_iter( self.__index.back() )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(__pyx_v_self, __pyx_v_self->__pyx___index->back()); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":50
 * 
 * 
 *     cpdef end(self):             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__BaseTreeSeries.end", __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_10redblackpy_6series_11tree_series_16__BaseTreeSeries_11end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_11end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("end (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_10end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_10end(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("end", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_end(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 50, __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("redblackpy.series.tree_series.__BaseTreeSeries.end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":58
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         self.__iter_mode = True
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_13on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 58, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_13on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 58, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 58, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":60
 *     cpdef void on_itermode(self):
 * 
 *         self.__iter_mode = True             # <<<<<<<<<<<<<<
 *         self.__last_call = deref(self.__index.begin())
 * 
 */
  __pyx_v_self->__pyx___iter_mode = 1;

  /* "redblackpy/cython_source/base_tree_series.pxi":61
 * 
 *         self.__iter_mode = True
 *         self.__last_call = deref(self.__index.begin())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___last_call = (*__pyx_v_self->__pyx___index->begin());

  /* "redblackpy/cython_source/base_tree_series.pxi":58
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         self.__iter_mode = True
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__BaseTreeSeries.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_13on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_13on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_12on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_12on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 58, __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("redblackpy.series.tree_series.__BaseTreeSeries.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":64
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         self.__iter_mode = False
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_15off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_15off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 64, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 64, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":66
 *     cpdef void off_itermode(self):
 * 
 *         self.__iter_mode = False             # <<<<<<<<<<<<<<
 *         self.__last_call = deref(self.__index.begin())
 * 
 */
  __pyx_v_self->__pyx___iter_mode = 0;

  /* "redblackpy/cython_source/base_tree_series.pxi":67
 * 
 *         self.__iter_mode = False
 *         self.__last_call = deref(self.__index.begin())             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___last_call = (*__pyx_v_self->__pyx___index->begin());

  /* "redblackpy/cython_source/base_tree_series.pxi":64
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         self.__iter_mode = False
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__BaseTreeSeries.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_15off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_15off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_14off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_14off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 64, __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("redblackpy.series.tree_series.__BaseTreeSeries.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":70
 * 
 * 
 *     cdef inline rb_tree_ptr get_tree(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__index
 */

static __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tree", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":72
 *     cdef inline rb_tree_ptr get_tree(self):
 * 
 *         return self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_self->__pyx___index;
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":70
 * 
 * 
 *     cdef inline rb_tree_ptr get_tree(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__index
 */

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

/* "redblackpy/cython_source/base_tree_series.pxi":75
 * 
 * 
 *     cdef inline node_ptr link(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__index.link()
 */

static CYTHON_INLINE __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("link", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":77
 *     cdef inline node_ptr link(self):
 * 
 *         return self.__index.link()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_self->__pyx___index->link();
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":75
 * 
 * 
 *     cdef inline node_ptr link(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__index.link()
 */

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

/* "redblackpy/cython_source/base_tree_series.pxi":80
 * 
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__index.size()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_16__len__(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static Py_ssize_t __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_16__len__(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":82
 *     def __len__(self):
 * 
 *         return self.__index.size()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_self->__pyx___index->size();
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":80
 * 
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__index.size()
 */

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

/* "redblackpy/cython_source/base_tree_series.pxi":85
 * 
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_18__contains__(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_18__contains__(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":87
 *     def __contains__(self, key):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/base_tree_series.pxi":88
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         cdef node_ptr node = self.__index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if ( node != self.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx___index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(2, 88, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/base_tree_series.pxi":90
 *         cdef node_ptr node = self.__index.search(c_key)
 * 
 *         if ( node != self.link() ):             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(__pyx_v_self)) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/base_tree_series.pxi":91
 * 
 *         if ( node != self.link() ):
 *             return True             # <<<<<<<<<<<<<<
 * 
 *         return False
 */
    __pyx_r = 1;
    goto __pyx_L0;

    /* "redblackpy/cython_source/base_tree_series.pxi":90
 *         cdef node_ptr node = self.__index.search(c_key)
 * 
 *         if ( node != self.link() ):             # <<<<<<<<<<<<<<
 *             return True
 * 
 */
  }

  /* "redblackpy/cython_source/base_tree_series.pxi":93
 *             return True
 * 
 *         return False             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":85
 * 
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__BaseTreeSeries.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/base_tree_series.pxi":96
 * 
 * 
 *     cdef inline __get_key_from_ptr(self, node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *         return <object>deref(node).key.data
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("__get_key_from_ptr", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":98
 *     cdef inline __get_key_from_ptr(self, node_ptr node):
 * 
 *         return <object>deref(node).key.data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (*__pyx_v_node).key.data;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":96
 * 
 * 
 *     cdef inline __get_key_from_ptr(self, node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *         return <object>deref(node).key.data
 */

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

/* "redblackpy/cython_source/base_tree_series.pxi":101
 * 
 * 
 *     cdef inline __get_key_from_iter(self, iterator node):             # <<<<<<<<<<<<<<
 * 
 *         return <object>deref( deref(node) ).key.data
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("__get_key_from_iter", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":103
 *     cdef inline __get_key_from_iter(self, iterator node):
 * 
 *         return <object>deref( deref(node) ).key.data             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (*(*__pyx_v_node)).key.data;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/base_tree_series.pxi":101
 * 
 * 
 *     cdef inline __get_key_from_iter(self, iterator node):             # <<<<<<<<<<<<<<
 * 
 *         return <object>deref( deref(node) ).key.data
 */

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

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_20__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__BaseTreeSeries.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_22__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_16__BaseTreeSeries_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__BaseTreeSeries.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":16
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint8_t __interpolate_floor_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint8_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_uint8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":20
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint8_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":21
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_uint8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":20
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint8_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":23
 *         return __deref_value_ptr_uint8_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":16
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint8_t __interpolate_floor_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint8_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":26
 * 
 * 
 * cdef uint8_t __interpolate_ceil_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint8_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint8_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_uint8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":30
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint8_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":31
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_uint8_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":30
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint8_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":33
 *         return __deref_value_ptr_uint8_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":26
 * 
 * 
 * cdef uint8_t __interpolate_ceil_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint8_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":36
 * 
 * 
 * cdef uint8_t __interpolate_nn_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint8_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_uint8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":43
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":45
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":46
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":48
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint8_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 48, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":49
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_uint8_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_uint8_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":48
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint8_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":51
 *             return __deref_value_ptr_uint8_t(node_2)
 * 
 *         return __deref_value_ptr_uint8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":43
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":53
 *         return __deref_value_ptr_uint8_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint8_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":54
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_uint8_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_uint8_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":53
 *         return __deref_value_ptr_uint8_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint8_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":56
 *         return __deref_value_ptr_uint8_t(node_2)
 * 
 *     return __deref_value_ptr_uint8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":36
 * 
 * 
 * cdef uint8_t __interpolate_nn_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint8_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":59
 * 
 * 
 * cdef uint8_t __interpolate_linear_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint8_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_uint8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":68
 *     cdef uint8_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":70
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":71
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint8_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":72
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_uint8_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 72, __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_7 = __Pyx_PyInt_As_unsigned_char(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(5, 72, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":73
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_uint8_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":75
 *         value = __deref_value_ptr_uint8_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_uint8_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":68
 *     cdef uint8_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":77
 *         return value + tan*(__deref_value_ptr_uint8_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":59
 * 
 * 
 * cdef uint8_t __interpolate_linear_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint8_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":80
 * 
 * 
 * cdef uint8_t __interpolate_keys_only_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint8_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_uint8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":84
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":86
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint8_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 86, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 86, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":87
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_uint8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":86
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint8_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":84
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":89
 *             return __deref_value_ptr_uint8_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <uint8_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":91
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <uint8_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":80
 * 
 * 
 * cdef uint8_t __interpolate_keys_only_uint8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint8_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":115
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint16_t __interpolate_floor_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint16_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_uint16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":119
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint16_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":120
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_uint16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":119
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint16_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":122
 *         return __deref_value_ptr_uint16_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":115
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint16_t __interpolate_floor_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint16_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":125
 * 
 * 
 * cdef uint16_t __interpolate_ceil_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint16_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint16_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_uint16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":129
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint16_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":130
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_uint16_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":129
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint16_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":132
 *         return __deref_value_ptr_uint16_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":125
 * 
 * 
 * cdef uint16_t __interpolate_ceil_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint16_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":135
 * 
 * 
 * cdef uint16_t __interpolate_nn_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint16_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_uint16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":142
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":144
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":145
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":147
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint16_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 147, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 147, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":148
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_uint16_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_uint16_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":147
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint16_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":150
 *             return __deref_value_ptr_uint16_t(node_2)
 * 
 *         return __deref_value_ptr_uint16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":142
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":152
 *         return __deref_value_ptr_uint16_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint16_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":153
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_uint16_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_uint16_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":152
 *         return __deref_value_ptr_uint16_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint16_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":155
 *         return __deref_value_ptr_uint16_t(node_2)
 * 
 *     return __deref_value_ptr_uint16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":135
 * 
 * 
 * cdef uint16_t __interpolate_nn_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint16_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":158
 * 
 * 
 * cdef uint16_t __interpolate_linear_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint16_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_uint16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":167
 *     cdef uint16_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":169
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":170
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint16_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":171
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_uint16_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 171, __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_7 = __Pyx_PyInt_As_unsigned_short(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(5, 171, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":172
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_uint16_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":174
 *         value = __deref_value_ptr_uint16_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_uint16_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":167
 *     cdef uint16_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":176
 *         return value + tan*(__deref_value_ptr_uint16_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":158
 * 
 * 
 * cdef uint16_t __interpolate_linear_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint16_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":179
 * 
 * 
 * cdef uint16_t __interpolate_keys_only_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint16_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_uint16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":183
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":185
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint16_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 185, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 185, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":186
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_uint16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":185
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint16_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":183
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":188
 *             return __deref_value_ptr_uint16_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <uint16_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":190
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <uint16_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":179
 * 
 * 
 * cdef uint16_t __interpolate_keys_only_uint16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint16_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":214
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint32_t __interpolate_floor_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint32_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_uint32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":218
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint32_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":219
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_uint32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":218
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint32_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":221
 *         return __deref_value_ptr_uint32_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":214
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint32_t __interpolate_floor_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint32_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":224
 * 
 * 
 * cdef uint32_t __interpolate_ceil_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint32_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint32_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_uint32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":228
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint32_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":229
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_uint32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":228
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint32_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":231
 *         return __deref_value_ptr_uint32_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":224
 * 
 * 
 * cdef uint32_t __interpolate_ceil_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint32_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":234
 * 
 * 
 * cdef uint32_t __interpolate_nn_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint32_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_uint32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":241
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":243
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":244
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":246
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint32_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 246, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 246, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":247
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_uint32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_uint32_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":246
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint32_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":249
 *             return __deref_value_ptr_uint32_t(node_2)
 * 
 *         return __deref_value_ptr_uint32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":241
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":251
 *         return __deref_value_ptr_uint32_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint32_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":252
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_uint32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_uint32_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":251
 *         return __deref_value_ptr_uint32_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint32_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":254
 *         return __deref_value_ptr_uint32_t(node_2)
 * 
 *     return __deref_value_ptr_uint32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":234
 * 
 * 
 * cdef uint32_t __interpolate_nn_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint32_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":257
 * 
 * 
 * cdef uint32_t __interpolate_linear_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint32_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_uint32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":266
 *     cdef uint32_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":268
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":269
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint32_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":270
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_uint32_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 270, __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_7 = __Pyx_PyInt_As_unsigned_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(5, 270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":271
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_uint32_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":273
 *         value = __deref_value_ptr_uint32_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_uint32_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":266
 *     cdef uint32_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":275
 *         return value + tan*(__deref_value_ptr_uint32_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":257
 * 
 * 
 * cdef uint32_t __interpolate_linear_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint32_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":278
 * 
 * 
 * cdef uint32_t __interpolate_keys_only_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint32_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_uint32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":282
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":284
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint32_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 284, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 284, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":285
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_uint32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":284
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint32_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":282
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":287
 *             return __deref_value_ptr_uint32_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <uint32_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":289
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <uint32_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":278
 * 
 * 
 * cdef uint32_t __interpolate_keys_only_uint32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint32_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":313
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint64_t __interpolate_floor_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint64_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_uint64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":317
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint64_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":318
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_uint64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":317
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint64_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":320
 *         return __deref_value_ptr_uint64_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":313
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint64_t __interpolate_floor_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint64_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":323
 * 
 * 
 * cdef uint64_t __interpolate_ceil_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint64_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint64_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_uint64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":327
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint64_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":328
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_uint64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":327
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint64_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":330
 *         return __deref_value_ptr_uint64_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":323
 * 
 * 
 * cdef uint64_t __interpolate_ceil_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint64_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":333
 * 
 * 
 * cdef uint64_t __interpolate_nn_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint64_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_uint64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":340
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":342
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":343
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":345
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint64_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 345, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":346
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_uint64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_uint64_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":345
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint64_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":348
 *             return __deref_value_ptr_uint64_t(node_2)
 * 
 *         return __deref_value_ptr_uint64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":340
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":350
 *         return __deref_value_ptr_uint64_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint64_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":351
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_uint64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_uint64_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":350
 *         return __deref_value_ptr_uint64_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint64_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":353
 *         return __deref_value_ptr_uint64_t(node_2)
 * 
 *     return __deref_value_ptr_uint64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":333
 * 
 * 
 * cdef uint64_t __interpolate_nn_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint64_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":356
 * 
 * 
 * cdef uint64_t __interpolate_linear_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint64_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_uint64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":365
 *     cdef uint64_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":367
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":368
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint64_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":369
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_uint64_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 369, __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_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 369, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":370
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_uint64_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":372
 *         value = __deref_value_ptr_uint64_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_uint64_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":365
 *     cdef uint64_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":374
 *         return value + tan*(__deref_value_ptr_uint64_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":356
 * 
 * 
 * cdef uint64_t __interpolate_linear_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint64_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":377
 * 
 * 
 * cdef uint64_t __interpolate_keys_only_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint64_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_uint64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":381
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":383
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint64_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 383, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 383, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":384
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_uint64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":383
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint64_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":381
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":386
 *             return __deref_value_ptr_uint64_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <uint64_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":388
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <uint64_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":377
 * 
 * 
 * cdef uint64_t __interpolate_keys_only_uint64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint64_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":412
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint96_t __interpolate_floor_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint96_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_uint96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":416
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint96_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":417
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_uint96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":416
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint96_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":419
 *         return __deref_value_ptr_uint96_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":412
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint96_t __interpolate_floor_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint96_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":422
 * 
 * 
 * cdef uint96_t __interpolate_ceil_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint96_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint96_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_uint96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":426
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint96_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":427
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_uint96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":426
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint96_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":429
 *         return __deref_value_ptr_uint96_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":422
 * 
 * 
 * cdef uint96_t __interpolate_ceil_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint96_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":432
 * 
 * 
 * cdef uint96_t __interpolate_nn_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint96_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_uint96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":439
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":441
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":442
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":444
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint96_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 444, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":445
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_uint96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_uint96_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":444
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint96_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":447
 *             return __deref_value_ptr_uint96_t(node_2)
 * 
 *         return __deref_value_ptr_uint96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":439
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":449
 *         return __deref_value_ptr_uint96_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint96_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":450
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_uint96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_uint96_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":449
 *         return __deref_value_ptr_uint96_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint96_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":452
 *         return __deref_value_ptr_uint96_t(node_2)
 * 
 *     return __deref_value_ptr_uint96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":432
 * 
 * 
 * cdef uint96_t __interpolate_nn_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint96_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":455
 * 
 * 
 * cdef uint96_t __interpolate_linear_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint96_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_uint96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":464
 *     cdef uint96_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":466
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":467
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint96_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":468
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_uint96_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 468, __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_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 468, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":469
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_uint96_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":471
 *         value = __deref_value_ptr_uint96_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_uint96_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":464
 *     cdef uint96_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":473
 *         return value + tan*(__deref_value_ptr_uint96_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":455
 * 
 * 
 * cdef uint96_t __interpolate_linear_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint96_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":476
 * 
 * 
 * cdef uint96_t __interpolate_keys_only_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint96_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_uint96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":480
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":482
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint96_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 482, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 482, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":483
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_uint96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":482
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint96_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":480
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":485
 *             return __deref_value_ptr_uint96_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <uint96_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":487
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <uint96_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":476
 * 
 * 
 * cdef uint96_t __interpolate_keys_only_uint96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint96_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":511
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint128_t __interpolate_floor_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint128_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_uint128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":515
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint128_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":516
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_uint128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":515
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint128_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":518
 *         return __deref_value_ptr_uint128_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":511
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef uint128_t __interpolate_floor_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, uint128_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":521
 * 
 * 
 * cdef uint128_t __interpolate_ceil_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint128_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint128_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_uint128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":525
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint128_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":526
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_uint128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":525
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint128_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":528
 *         return __deref_value_ptr_uint128_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":521
 * 
 * 
 * cdef uint128_t __interpolate_ceil_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, uint128_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":531
 * 
 * 
 * cdef uint128_t __interpolate_nn_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint128_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_uint128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":538
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":540
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":541
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":543
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint128_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 543, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 543, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":544
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_uint128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_uint128_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":543
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint128_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":546
 *             return __deref_value_ptr_uint128_t(node_2)
 * 
 *         return __deref_value_ptr_uint128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":538
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":548
 *         return __deref_value_ptr_uint128_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint128_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":549
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_uint128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_uint128_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":548
 *         return __deref_value_ptr_uint128_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_uint128_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":551
 *         return __deref_value_ptr_uint128_t(node_2)
 * 
 *     return __deref_value_ptr_uint128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":531
 * 
 * 
 * cdef uint128_t __interpolate_nn_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, uint128_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":554
 * 
 * 
 * cdef uint128_t __interpolate_linear_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint128_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_uint128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":563
 *     cdef uint128_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":565
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":566
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint128_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":567
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_uint128_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 567, __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_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_6); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 567, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":568
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_uint128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_uint128_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":570
 *         value = __deref_value_ptr_uint128_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_uint128_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":563
 *     cdef uint128_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":572
 *         return value + tan*(__deref_value_ptr_uint128_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":554
 * 
 * 
 * cdef uint128_t __interpolate_linear_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, uint128_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":575
 * 
 * 
 * cdef uint128_t __interpolate_keys_only_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint128_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_uint128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":579
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":581
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint128_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 581, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 581, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":582
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_uint128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":581
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_uint128_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":579
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":584
 *             return __deref_value_ptr_uint128_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <uint128_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":586
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <uint128_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":575
 * 
 * 
 * cdef uint128_t __interpolate_keys_only_uint128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, uint128_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":610
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int8_t __interpolate_floor_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int8_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_int8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":614
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int8_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":615
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_int8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":614
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int8_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":617
 *         return __deref_value_ptr_int8_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":610
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int8_t __interpolate_floor_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int8_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":620
 * 
 * 
 * cdef int8_t __interpolate_ceil_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int8_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int8_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_int8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":624
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int8_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":625
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_int8_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":624
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int8_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":627
 *         return __deref_value_ptr_int8_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":620
 * 
 * 
 * cdef int8_t __interpolate_ceil_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int8_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":630
 * 
 * 
 * cdef int8_t __interpolate_nn_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int8_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_int8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":637
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":639
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":640
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":642
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int8_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 642, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 642, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":643
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_int8_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_int8_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":642
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int8_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":645
 *             return __deref_value_ptr_int8_t(node_2)
 * 
 *         return __deref_value_ptr_int8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":637
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":647
 *         return __deref_value_ptr_int8_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int8_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":648
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_int8_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_int8_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":647
 *         return __deref_value_ptr_int8_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int8_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":650
 *         return __deref_value_ptr_int8_t(node_2)
 * 
 *     return __deref_value_ptr_int8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":630
 * 
 * 
 * cdef int8_t __interpolate_nn_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int8_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":653
 * 
 * 
 * cdef int8_t __interpolate_linear_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int8_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_int8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":662
 *     cdef int8_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":664
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":665
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int8_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":666
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_int8_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 666, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 666, __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_7 = __Pyx_PyInt_As_signed__char(__pyx_t_6); if (unlikely((__pyx_t_7 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(5, 666, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":667
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_int8_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":669
 *         value = __deref_value_ptr_int8_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_int8_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":662
 *     cdef int8_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":671
 *         return value + tan*(__deref_value_ptr_int8_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":653
 * 
 * 
 * cdef int8_t __interpolate_linear_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int8_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":674
 * 
 * 
 * cdef int8_t __interpolate_keys_only_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int8_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_int8_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":678
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":680
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int8_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 680, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 680, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":681
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_int8_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":680
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int8_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":678
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":683
 *             return __deref_value_ptr_int8_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <int8_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":685
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <int8_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":674
 * 
 * 
 * cdef int8_t __interpolate_keys_only_int8_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int8_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":709
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int16_t __interpolate_floor_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int16_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_int16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":713
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int16_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":714
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_int16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":713
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int16_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":716
 *         return __deref_value_ptr_int16_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":709
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int16_t __interpolate_floor_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int16_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":719
 * 
 * 
 * cdef int16_t __interpolate_ceil_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int16_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int16_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_int16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":723
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int16_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":724
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_int16_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":723
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int16_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":726
 *         return __deref_value_ptr_int16_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":719
 * 
 * 
 * cdef int16_t __interpolate_ceil_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int16_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":729
 * 
 * 
 * cdef int16_t __interpolate_nn_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int16_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_int16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":736
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":738
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":739
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":741
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int16_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 741, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 741, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 741, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 741, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":742
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_int16_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_int16_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":741
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int16_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":744
 *             return __deref_value_ptr_int16_t(node_2)
 * 
 *         return __deref_value_ptr_int16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":736
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":746
 *         return __deref_value_ptr_int16_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int16_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":747
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_int16_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_int16_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":746
 *         return __deref_value_ptr_int16_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int16_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":749
 *         return __deref_value_ptr_int16_t(node_2)
 * 
 *     return __deref_value_ptr_int16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":729
 * 
 * 
 * cdef int16_t __interpolate_nn_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int16_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":752
 * 
 * 
 * cdef int16_t __interpolate_linear_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int16_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_int16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":761
 *     cdef int16_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":763
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":764
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int16_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":765
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_int16_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 765, __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_7 = __Pyx_PyInt_As_short(__pyx_t_6); if (unlikely((__pyx_t_7 == (short)-1) && PyErr_Occurred())) __PYX_ERR(5, 765, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":766
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_int16_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":768
 *         value = __deref_value_ptr_int16_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_int16_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":761
 *     cdef int16_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":770
 *         return value + tan*(__deref_value_ptr_int16_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":752
 * 
 * 
 * cdef int16_t __interpolate_linear_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int16_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":773
 * 
 * 
 * cdef int16_t __interpolate_keys_only_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int16_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_int16_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":777
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":779
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int16_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 779, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 779, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":780
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_int16_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":779
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int16_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":777
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":782
 *             return __deref_value_ptr_int16_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <int16_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":784
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <int16_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":773
 * 
 * 
 * cdef int16_t __interpolate_keys_only_int16_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int16_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":808
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int32_t __interpolate_floor_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int32_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_int32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":812
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int32_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":813
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_int32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":812
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int32_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":815
 *         return __deref_value_ptr_int32_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":808
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int32_t __interpolate_floor_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int32_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":818
 * 
 * 
 * cdef int32_t __interpolate_ceil_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int32_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int32_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_int32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":822
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int32_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":823
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_int32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":822
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int32_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":825
 *         return __deref_value_ptr_int32_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":818
 * 
 * 
 * cdef int32_t __interpolate_ceil_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int32_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":828
 * 
 * 
 * cdef int32_t __interpolate_nn_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int32_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_int32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":835
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":837
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":838
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":840
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int32_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 840, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":841
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_int32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_int32_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":840
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int32_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":843
 *             return __deref_value_ptr_int32_t(node_2)
 * 
 *         return __deref_value_ptr_int32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":835
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":845
 *         return __deref_value_ptr_int32_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int32_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":846
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_int32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_int32_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":845
 *         return __deref_value_ptr_int32_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int32_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":848
 *         return __deref_value_ptr_int32_t(node_2)
 * 
 *     return __deref_value_ptr_int32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":828
 * 
 * 
 * cdef int32_t __interpolate_nn_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int32_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":851
 * 
 * 
 * cdef int32_t __interpolate_linear_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int32_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_int32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":860
 *     cdef int32_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":862
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":863
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int32_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":864
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_int32_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 864, __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_7 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 864, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":865
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_int32_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":867
 *         value = __deref_value_ptr_int32_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_int32_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":860
 *     cdef int32_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":869
 *         return value + tan*(__deref_value_ptr_int32_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":851
 * 
 * 
 * cdef int32_t __interpolate_linear_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int32_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":872
 * 
 * 
 * cdef int32_t __interpolate_keys_only_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int32_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_int32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":876
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":878
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int32_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 878, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 878, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":879
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_int32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":878
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int32_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":876
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":881
 *             return __deref_value_ptr_int32_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <int32_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":883
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <int32_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":872
 * 
 * 
 * cdef int32_t __interpolate_keys_only_int32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int32_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":907
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int64_t __interpolate_floor_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int64_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_int64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":911
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int64_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":912
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_int64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":911
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int64_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":914
 *         return __deref_value_ptr_int64_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":907
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int64_t __interpolate_floor_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int64_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":917
 * 
 * 
 * cdef int64_t __interpolate_ceil_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int64_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int64_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_int64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":921
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int64_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":922
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_int64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":921
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int64_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":924
 *         return __deref_value_ptr_int64_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":917
 * 
 * 
 * cdef int64_t __interpolate_ceil_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int64_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":927
 * 
 * 
 * cdef int64_t __interpolate_nn_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int64_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_int64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":934
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":936
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":937
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":939
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int64_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 939, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 939, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":940
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_int64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_int64_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":939
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int64_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":942
 *             return __deref_value_ptr_int64_t(node_2)
 * 
 *         return __deref_value_ptr_int64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":934
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":944
 *         return __deref_value_ptr_int64_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int64_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":945
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_int64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_int64_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":944
 *         return __deref_value_ptr_int64_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int64_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":947
 *         return __deref_value_ptr_int64_t(node_2)
 * 
 *     return __deref_value_ptr_int64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":927
 * 
 * 
 * cdef int64_t __interpolate_nn_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int64_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":950
 * 
 * 
 * cdef int64_t __interpolate_linear_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int64_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_int64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":959
 *     cdef int64_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":961
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":962
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int64_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":963
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_int64_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 963, __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_7 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_6); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 963, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":964
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_int64_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":966
 *         value = __deref_value_ptr_int64_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_int64_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":959
 *     cdef int64_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":968
 *         return value + tan*(__deref_value_ptr_int64_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":950
 * 
 * 
 * cdef int64_t __interpolate_linear_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int64_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":971
 * 
 * 
 * cdef int64_t __interpolate_keys_only_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int64_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_int64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":975
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":977
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int64_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 977, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 977, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":978
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_int64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":977
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int64_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":975
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":980
 *             return __deref_value_ptr_int64_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <int64_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":982
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <int64_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":971
 * 
 * 
 * cdef int64_t __interpolate_keys_only_int64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int64_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1006
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int96_t __interpolate_floor_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int96_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_int96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1010
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int96_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1011
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_int96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1010
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int96_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1013
 *         return __deref_value_ptr_int96_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1006
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int96_t __interpolate_floor_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int96_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1016
 * 
 * 
 * cdef int96_t __interpolate_ceil_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int96_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int96_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_int96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1020
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int96_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1021
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_int96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1020
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int96_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1023
 *         return __deref_value_ptr_int96_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1016
 * 
 * 
 * cdef int96_t __interpolate_ceil_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int96_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1026
 * 
 * 
 * cdef int96_t __interpolate_nn_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int96_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_int96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1033
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1035
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1036
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1038
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int96_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1038, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1038, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1039
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_int96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_int96_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1038
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int96_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1041
 *             return __deref_value_ptr_int96_t(node_2)
 * 
 *         return __deref_value_ptr_int96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1033
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1043
 *         return __deref_value_ptr_int96_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int96_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1044
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_int96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_int96_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1043
 *         return __deref_value_ptr_int96_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int96_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1046
 *         return __deref_value_ptr_int96_t(node_2)
 * 
 *     return __deref_value_ptr_int96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1026
 * 
 * 
 * cdef int96_t __interpolate_nn_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int96_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1049
 * 
 * 
 * cdef int96_t __interpolate_linear_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int96_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_int96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1058
 *     cdef int96_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1060
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1061
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int96_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1062
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_int96_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1062, __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_7 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_6); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1062, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1063
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_int96_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1065
 *         value = __deref_value_ptr_int96_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_int96_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1058
 *     cdef int96_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1067
 *         return value + tan*(__deref_value_ptr_int96_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1049
 * 
 * 
 * cdef int96_t __interpolate_linear_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int96_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1070
 * 
 * 
 * cdef int96_t __interpolate_keys_only_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int96_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_int96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1074
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1076
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int96_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1076, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1077
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_int96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1076
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int96_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1074
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1079
 *             return __deref_value_ptr_int96_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <int96_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1081
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <int96_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1070
 * 
 * 
 * cdef int96_t __interpolate_keys_only_int96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int96_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1105
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int128_t __interpolate_floor_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int128_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_int128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1109
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int128_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1110
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_int128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1109
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int128_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1112
 *         return __deref_value_ptr_int128_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1105
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef int128_t __interpolate_floor_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, int128_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1115
 * 
 * 
 * cdef int128_t __interpolate_ceil_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int128_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int128_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_int128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1119
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int128_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1120
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_int128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1119
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int128_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1122
 *         return __deref_value_ptr_int128_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1115
 * 
 * 
 * cdef int128_t __interpolate_ceil_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, int128_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1125
 * 
 * 
 * cdef int128_t __interpolate_nn_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int128_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_int128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1132
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1134
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1135
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1137
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int128_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1137, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1138
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_int128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_int128_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1137
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int128_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1140
 *             return __deref_value_ptr_int128_t(node_2)
 * 
 *         return __deref_value_ptr_int128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1132
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1142
 *         return __deref_value_ptr_int128_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int128_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1143
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_int128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_int128_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1142
 *         return __deref_value_ptr_int128_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_int128_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1145
 *         return __deref_value_ptr_int128_t(node_2)
 * 
 *     return __deref_value_ptr_int128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1125
 * 
 * 
 * cdef int128_t __interpolate_nn_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, int128_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1148
 * 
 * 
 * cdef int128_t __interpolate_linear_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int128_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_int128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1157
 *     cdef int128_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1159
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1160
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int128_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1161
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_int128_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1161, __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_7 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_6); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(5, 1161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1162
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_int128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_int128_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1164
 *         value = __deref_value_ptr_int128_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_int128_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1157
 *     cdef int128_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1166
 *         return value + tan*(__deref_value_ptr_int128_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1148
 * 
 * 
 * cdef int128_t __interpolate_linear_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, int128_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1169
 * 
 * 
 * cdef int128_t __interpolate_keys_only_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int128_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_int128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1173
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1175
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int128_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1175, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1175, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1176
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_int128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1175
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_int128_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1173
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1178
 *             return __deref_value_ptr_int128_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <int128_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1180
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <int128_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)0xdeadbeef);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1169
 * 
 * 
 * cdef int128_t __interpolate_keys_only_int128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, int128_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1204
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float32_t __interpolate_floor_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float32_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_float32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1208
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float32_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1209
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_float32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1208
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float32_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1211
 *         return __deref_value_ptr_float32_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1204
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float32_t __interpolate_floor_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float32_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1214
 * 
 * 
 * cdef float32_t __interpolate_ceil_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float32_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float32_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_float32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1218
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float32_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1219
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_float32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1218
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float32_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1221
 *         return __deref_value_ptr_float32_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1214
 * 
 * 
 * cdef float32_t __interpolate_ceil_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float32_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1224
 * 
 * 
 * cdef float32_t __interpolate_nn_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float32_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_float32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1231
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1233
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1234
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1236
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float32_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1236, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1236, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1237
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_float32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_float32_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1236
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float32_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1239
 *             return __deref_value_ptr_float32_t(node_2)
 * 
 *         return __deref_value_ptr_float32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1231
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1241
 *         return __deref_value_ptr_float32_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float32_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1242
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_float32_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_float32_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1241
 *         return __deref_value_ptr_float32_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float32_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1244
 *         return __deref_value_ptr_float32_t(node_2)
 * 
 *     return __deref_value_ptr_float32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1224
 * 
 * 
 * cdef float32_t __interpolate_nn_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float32_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1247
 * 
 * 
 * cdef float32_t __interpolate_linear_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float32_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_float32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1256
 *     cdef float32_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1258
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1259
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float32_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1260
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_float32_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1260, __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_7 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(5, 1260, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1261
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_float32_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1263
 *         value = __deref_value_ptr_float32_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_float32_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1256
 *     cdef float32_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1265
 *         return value + tan*(__deref_value_ptr_float32_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1247
 * 
 * 
 * cdef float32_t __interpolate_linear_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float32_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1268
 * 
 * 
 * cdef float32_t __interpolate_keys_only_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float32_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_float32_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1272
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1274
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float32_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1274, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1274, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1275
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_float32_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1274
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float32_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1272
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1277
 *             return __deref_value_ptr_float32_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <float32_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1279
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <float32_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)3735928559.0);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1268
 * 
 * 
 * cdef float32_t __interpolate_keys_only_float32_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float32_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1303
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float64_t __interpolate_floor_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float64_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_float64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1307
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float64_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1308
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_float64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1307
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float64_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1310
 *         return __deref_value_ptr_float64_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1303
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float64_t __interpolate_floor_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float64_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1313
 * 
 * 
 * cdef float64_t __interpolate_ceil_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float64_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float64_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_float64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1317
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float64_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1318
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_float64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1317
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float64_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1320
 *         return __deref_value_ptr_float64_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1313
 * 
 * 
 * cdef float64_t __interpolate_ceil_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float64_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1323
 * 
 * 
 * cdef float64_t __interpolate_nn_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float64_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_float64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1330
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1332
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1333
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1335
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float64_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1335, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1336
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_float64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_float64_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1335
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float64_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1338
 *             return __deref_value_ptr_float64_t(node_2)
 * 
 *         return __deref_value_ptr_float64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1330
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1340
 *         return __deref_value_ptr_float64_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float64_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1341
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_float64_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_float64_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1340
 *         return __deref_value_ptr_float64_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float64_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1343
 *         return __deref_value_ptr_float64_t(node_2)
 * 
 *     return __deref_value_ptr_float64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1323
 * 
 * 
 * cdef float64_t __interpolate_nn_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float64_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1346
 * 
 * 
 * cdef float64_t __interpolate_linear_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float64_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_float64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1355
 *     cdef float64_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1357
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1358
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float64_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1359
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_float64_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1359, __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_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1359, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1360
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_float64_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1362
 *         value = __deref_value_ptr_float64_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_float64_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1355
 *     cdef float64_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1364
 *         return value + tan*(__deref_value_ptr_float64_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1346
 * 
 * 
 * cdef float64_t __interpolate_linear_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float64_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1367
 * 
 * 
 * cdef float64_t __interpolate_keys_only_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float64_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_float64_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1371
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1373
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float64_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1373, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1373, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1374
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_float64_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1373
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float64_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1371
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1376
 *             return __deref_value_ptr_float64_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <float64_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1378
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <float64_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)3735928559.0);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1367
 * 
 * 
 * cdef float64_t __interpolate_keys_only_float64_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float64_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1402
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float80_t __interpolate_floor_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float80_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_float80_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1406
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float80_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1407
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_float80_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1406
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float80_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1409
 *         return __deref_value_ptr_float80_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1402
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float80_t __interpolate_floor_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float80_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1412
 * 
 * 
 * cdef float80_t __interpolate_ceil_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float80_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float80_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_float80_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1416
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float80_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1417
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_float80_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1416
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float80_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1419
 *         return __deref_value_ptr_float80_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1412
 * 
 * 
 * cdef float80_t __interpolate_ceil_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float80_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1422
 * 
 * 
 * cdef float80_t __interpolate_nn_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float80_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_float80_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1429
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1431
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1432
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1434
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float80_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1434, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1434, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1435
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_float80_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_float80_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1434
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float80_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1437
 *             return __deref_value_ptr_float80_t(node_2)
 * 
 *         return __deref_value_ptr_float80_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1429
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1439
 *         return __deref_value_ptr_float80_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float80_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1440
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_float80_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_float80_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1439
 *         return __deref_value_ptr_float80_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float80_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1442
 *         return __deref_value_ptr_float80_t(node_2)
 * 
 *     return __deref_value_ptr_float80_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1422
 * 
 * 
 * cdef float80_t __interpolate_nn_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float80_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1445
 * 
 * 
 * cdef float80_t __interpolate_linear_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float80_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_float80_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1454
 *     cdef float80_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1456
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1457
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float80_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1458
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_float80_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1458, __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_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1458, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1459
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float80_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_float80_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1461
 *         value = __deref_value_ptr_float80_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_float80_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1454
 *     cdef float80_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1463
 *         return value + tan*(__deref_value_ptr_float80_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1445
 * 
 * 
 * cdef float80_t __interpolate_linear_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float80_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1466
 * 
 * 
 * cdef float80_t __interpolate_keys_only_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float80_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_float80_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1470
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1472
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float80_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1472, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1472, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1473
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_float80_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1472
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float80_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1470
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1475
 *             return __deref_value_ptr_float80_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <float80_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1477
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <float80_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)3735928559.0);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1466
 * 
 * 
 * cdef float80_t __interpolate_keys_only_float80_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float80_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1501
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float96_t __interpolate_floor_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float96_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_float96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1505
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float96_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1506
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_float96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1505
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float96_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1508
 *         return __deref_value_ptr_float96_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1501
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float96_t __interpolate_floor_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float96_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1511
 * 
 * 
 * cdef float96_t __interpolate_ceil_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float96_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float96_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_float96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1515
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float96_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1516
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_float96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1515
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float96_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1518
 *         return __deref_value_ptr_float96_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1511
 * 
 * 
 * cdef float96_t __interpolate_ceil_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float96_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1521
 * 
 * 
 * cdef float96_t __interpolate_nn_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float96_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_float96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1528
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1530
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1531
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1533
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float96_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1533, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1533, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1534
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_float96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_float96_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1533
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float96_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1536
 *             return __deref_value_ptr_float96_t(node_2)
 * 
 *         return __deref_value_ptr_float96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1528
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1538
 *         return __deref_value_ptr_float96_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float96_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1539
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_float96_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_float96_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1538
 *         return __deref_value_ptr_float96_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float96_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1541
 *         return __deref_value_ptr_float96_t(node_2)
 * 
 *     return __deref_value_ptr_float96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1521
 * 
 * 
 * cdef float96_t __interpolate_nn_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float96_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1544
 * 
 * 
 * cdef float96_t __interpolate_linear_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float96_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_float96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1553
 *     cdef float96_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1555
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1556
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float96_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1557
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_float96_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1557, __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_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1557, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1558
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_float96_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1560
 *         value = __deref_value_ptr_float96_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_float96_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1553
 *     cdef float96_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1562
 *         return value + tan*(__deref_value_ptr_float96_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1544
 * 
 * 
 * cdef float96_t __interpolate_linear_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float96_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1565
 * 
 * 
 * cdef float96_t __interpolate_keys_only_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float96_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_float96_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1569
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1571
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float96_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1571, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1571, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1572
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_float96_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1571
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float96_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1569
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1574
 *             return __deref_value_ptr_float96_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <float96_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1576
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <float96_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)3735928559.0);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1565
 * 
 * 
 * cdef float96_t __interpolate_keys_only_float96_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float96_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1600
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float128_t __interpolate_floor_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float128_t extrapolate,
 *                                           int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_floor_float128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1604
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float128_t(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1605
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_float128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1604
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float128_t(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1607
 *         return __deref_value_ptr_float128_t(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1600
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef float128_t __interpolate_floor_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, float128_t extrapolate,
 *                                           int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1610
 * 
 * 
 * cdef float128_t __interpolate_ceil_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float128_t extrapolate,
 *                                          int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float128_t(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("__interpolate_ceil_float128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1614
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float128_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1615
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_float128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1614
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float128_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1617
 *         return __deref_value_ptr_float128_t(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1610
 * 
 * 
 * cdef float128_t __interpolate_ceil_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, float128_t extrapolate,
 *                                          int32_t* error ):
 */

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

/* "redblackpy/cython_source/interpolation.pxi":1620
 * 
 * 
 * cdef float128_t __interpolate_nn_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float128_t extrapolate,
 *                                        int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_float128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1627
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1629
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1630
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1632
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float128_t(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1632, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1632, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1633
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_float128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_float128_t(node_1)
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_2);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1632
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float128_t(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1635
 *             return __deref_value_ptr_float128_t(node_2)
 * 
 *         return __deref_value_ptr_float128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_1);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1627
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1637
 *         return __deref_value_ptr_float128_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float128_t(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1638
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_float128_t(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_float128_t(node_1)
 */
    __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_2);
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1637
 *         return __deref_value_ptr_float128_t(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_float128_t(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1640
 *         return __deref_value_ptr_float128_t(node_2)
 * 
 *     return __deref_value_ptr_float128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1620
 * 
 * 
 * cdef float128_t __interpolate_nn_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, float128_t extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_nn_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1643
 * 
 * 
 * cdef float128_t __interpolate_linear_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float128_t extrapolate,
 *                                            int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_tan;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__interpolate_linear_float128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1652
 *     cdef float128_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1654
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1655
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float128_t(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1656
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_float128_t(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1656, __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_7 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(5, 1656, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_v_tan = __pyx_t_7;

    /* "redblackpy/cython_source/interpolation.pxi":1657
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_float128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_float128_t(node_2) - value)
 */
    __pyx_v_value = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_1);

    /* "redblackpy/cython_source/interpolation.pxi":1659
 *         value = __deref_value_ptr_float128_t(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_float128_t(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __pyx_r = (__pyx_v_value + (__pyx_v_tan * (__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_2) - __pyx_v_value)));
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1652
 *     cdef float128_t value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1661
 *         return value + tan*(__deref_value_ptr_float128_t(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1643
 * 
 * 
 * cdef float128_t __interpolate_linear_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, float128_t extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_linear_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1664
 * 
 * 
 * cdef float128_t __interpolate_keys_only_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float128_t extrapolate,
 *                                               int32_t* error ):
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_float128_t", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1668
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1670
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float128_t(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1670, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1670, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1671
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_float128_t(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __pyx_r = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node_1);
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1670
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_float128_t(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1668
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1673
 *             return __deref_value_ptr_float128_t(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <float128_t>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1675
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <float128_t>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)3735928559.0);
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1664
 * 
 * 
 * cdef float128_t __interpolate_keys_only_float128_t( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, float128_t extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__interpolate_keys_only_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1699
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef object __interpolate_floor_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, object extrapolate,
 *                                           int32_t* error ):
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, PyObject *__pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_floor_object", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1703
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_object(node_1)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1704
 * 
 *     if node_1 != link:
 *         return __deref_value_ptr_object(node_1)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1703
 *                                           int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_object(node_1)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1706
 *         return __deref_value_ptr_object(node_1)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_extrapolate);
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1699
 * 
 * # Interpolation for node wich key in [node_1->key, node_2->key]
 * cdef object __interpolate_floor_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                           node_ptr link, object extrapolate,
 *                                           int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__interpolate_floor_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1709
 * 
 * 
 * cdef object __interpolate_ceil_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, object extrapolate,
 *                                          int32_t* error ):
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_object(CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, CYTHON_UNUSED PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, PyObject *__pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_ceil_object", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1713
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_object(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1714
 * 
 *     if node_2 != link:
 *         return __deref_value_ptr_object(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(5, 1714, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1713
 *                                          int32_t* error ):
 * 
 *     if node_2 != link:             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_object(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1716
 *         return __deref_value_ptr_object(node_2)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_extrapolate);
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1709
 * 
 * 
 * cdef object __interpolate_ceil_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                          node_ptr link, object extrapolate,
 *                                          int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__interpolate_ceil_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1719
 * 
 * 
 * cdef object __interpolate_nn_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, object extrapolate,
 *                                        int32_t* error ):
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED PyObject *__pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_nn_object", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1726
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1728
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 * 
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1729
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 * 
 *         if (time_2 - key) <= (key - time_1):
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1731
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_object(node_2)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_RichCompare(__pyx_t_4, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1731, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1732
 * 
 *         if (time_2 - key) <= (key - time_1):
 *             return __deref_value_ptr_object(node_2)             # <<<<<<<<<<<<<<
 * 
 *         return __deref_value_ptr_object(node_1)
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_6 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1732, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_r = __pyx_t_6;
      __pyx_t_6 = 0;
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1731
 *         time_2 = <object>deref(node_2).key.data
 * 
 *         if (time_2 - key) <= (key - time_1):             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_object(node_2)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1734
 *             return __deref_value_ptr_object(node_2)
 * 
 *         return __deref_value_ptr_object(node_1)             # <<<<<<<<<<<<<<
 * 
 *     elif (node_1 == link):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1726
 *     cdef object time_2
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1736
 *         return __deref_value_ptr_object(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_object(node_2)
 * 
 */
  __pyx_t_1 = ((__pyx_v_node_1 == __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1737
 * 
 *     elif (node_1 == link):
 *         return __deref_value_ptr_object(node_2)             # <<<<<<<<<<<<<<
 * 
 *     return __deref_value_ptr_object(node_1)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/interpolation.pxi":1736
 *         return __deref_value_ptr_object(node_1)
 * 
 *     elif (node_1 == link):             # <<<<<<<<<<<<<<
 *         return __deref_value_ptr_object(node_2)
 * 
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1739
 *         return __deref_value_ptr_object(node_2)
 * 
 *     return __deref_value_ptr_object(node_1)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_6 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_r = __pyx_t_6;
  __pyx_t_6 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1719
 * 
 * 
 * cdef object __interpolate_nn_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                        node_ptr link, object extrapolate,
 *                                        int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__interpolate_nn_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1742
 * 
 * 
 * cdef object __interpolate_linear_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, object extrapolate,
 *                                            int32_t* error ):
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, PyObject *__pyx_v_extrapolate, CYTHON_UNUSED __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_v_time_1 = 0;
  PyObject *__pyx_v_time_2 = 0;
  PyObject *__pyx_v_tan = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_linear_object", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1751
 *     cdef object value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  __pyx_t_2 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_2) {
  } else {
    __pyx_t_1 = __pyx_t_2;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = ((__pyx_v_node_2 != __pyx_v_link) != 0);
  __pyx_t_1 = __pyx_t_2;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1753
 *     if (node_1 != link) and (node_2 != link):
 * 
 *         time_1 = <object>deref(node_1).key.data             # <<<<<<<<<<<<<<
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 */
    __pyx_t_3 = (*__pyx_v_node_1).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_1 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1754
 * 
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data             # <<<<<<<<<<<<<<
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_object(node_1)
 */
    __pyx_t_3 = (*__pyx_v_node_2).key.data;
    __pyx_t_4 = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    __pyx_v_time_2 = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1755
 *         time_1 = <object>deref(node_1).key.data
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)             # <<<<<<<<<<<<<<
 *         value = __deref_value_ptr_object(node_1)
 * 
 */
    __pyx_t_4 = PyNumber_Subtract(__pyx_v_key, __pyx_v_time_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(5, 1755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_time_2, __pyx_v_time_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1755, __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_v_tan = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1756
 *         time_2 = <object>deref(node_2).key.data
 *         tan = (key - time_1)/(time_2 - time_1)
 *         value = __deref_value_ptr_object(node_1)             # <<<<<<<<<<<<<<
 * 
 *         return value + tan*(__deref_value_ptr_object(node_2) - value)
 */
    __pyx_t_6 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_value = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "redblackpy/cython_source/interpolation.pxi":1758
 *         value = __deref_value_ptr_object(node_1)
 * 
 *         return value + tan*(__deref_value_ptr_object(node_2) - value)             # <<<<<<<<<<<<<<
 * 
 *     return extrapolate
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_6 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_v_value); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Multiply(__pyx_v_tan, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(5, 1758, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyNumber_Add(__pyx_v_value, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(5, 1758, __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;

    /* "redblackpy/cython_source/interpolation.pxi":1751
 *     cdef object value
 * 
 *     if (node_1 != link) and (node_2 != link):             # <<<<<<<<<<<<<<
 * 
 *         time_1 = <object>deref(node_1).key.data
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1760
 *         return value + tan*(__deref_value_ptr_object(node_2) - value)
 * 
 *     return extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_extrapolate);
  __pyx_r = __pyx_v_extrapolate;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1742
 * 
 * 
 * cdef object __interpolate_linear_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                            node_ptr link, object extrapolate,
 *                                            int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__interpolate_linear_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_time_1);
  __Pyx_XDECREF(__pyx_v_time_2);
  __Pyx_XDECREF(__pyx_v_tan);
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/interpolation.pxi":1763
 * 
 * 
 * cdef object __interpolate_keys_only_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, object extrapolate,
 *                                               int32_t* error ):
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_1, CYTHON_UNUSED __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node_2, PyObject *__pyx_v_key, __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_link, CYTHON_UNUSED PyObject *__pyx_v_extrapolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__interpolate_keys_only_object", 0);

  /* "redblackpy/cython_source/interpolation.pxi":1767
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  __pyx_t_1 = ((__pyx_v_node_1 != __pyx_v_link) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/interpolation.pxi":1769
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_object(node_1)
 * 
 */
    __pyx_t_2 = (*__pyx_v_node_1).key.data;
    __pyx_t_3 = PyObject_RichCompare(((PyObject *)__pyx_t_2), __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1769, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(5, 1769, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "redblackpy/cython_source/interpolation.pxi":1770
 * 
 *         if <object>deref(node_1).key.data == key:
 *             return __deref_value_ptr_object(node_1)             # <<<<<<<<<<<<<<
 * 
 *     error[0] = INT_KEY_ERROR
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(5, 1770, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_r = __pyx_t_3;
      __pyx_t_3 = 0;
      goto __pyx_L0;

      /* "redblackpy/cython_source/interpolation.pxi":1769
 *     if node_1 != link:
 * 
 *         if <object>deref(node_1).key.data == key:             # <<<<<<<<<<<<<<
 *             return __deref_value_ptr_object(node_1)
 * 
 */
    }

    /* "redblackpy/cython_source/interpolation.pxi":1767
 *                                               int32_t* error ):
 * 
 *     if node_1 != link:             # <<<<<<<<<<<<<<
 * 
 *         if <object>deref(node_1).key.data == key:
 */
  }

  /* "redblackpy/cython_source/interpolation.pxi":1772
 *             return __deref_value_ptr_object(node_1)
 * 
 *     error[0] = INT_KEY_ERROR             # <<<<<<<<<<<<<<
 * 
 *     return <object>0xdeadbeef
 */
  (__pyx_v_error[0]) = __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR;

  /* "redblackpy/cython_source/interpolation.pxi":1774
 *     error[0] = INT_KEY_ERROR
 * 
 *     return <object>0xdeadbeef             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_int_3735928559));
  __pyx_r = __pyx_int_3735928559;
  goto __pyx_L0;

  /* "redblackpy/cython_source/interpolation.pxi":1763
 * 
 * 
 * cdef object __interpolate_keys_only_object( node_ptr node_1, node_ptr node_2, key,             # <<<<<<<<<<<<<<
 *                                               node_ptr link, object extrapolate,
 *                                               int32_t* error ):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__interpolate_keys_only_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":15
 * 
 * 
 * cdef inline uint8_t __add_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___add_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_uint8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":17
 * cdef inline uint8_t __add_uint8_t(uint8_t a, uint8_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":15
 * 
 * 
 * cdef inline uint8_t __add_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":20
 * 
 * 
 * cdef inline uint8_t __sub_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_uint8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":22
 * cdef inline uint8_t __sub_uint8_t(uint8_t a, uint8_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":20
 * 
 * 
 * cdef inline uint8_t __sub_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":25
 * 
 * 
 * cdef inline uint8_t __mul_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_uint8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":27
 * cdef inline uint8_t __mul_uint8_t(uint8_t a, uint8_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":25
 * 
 * 
 * cdef inline uint8_t __mul_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":30
 * 
 * 
 * cdef inline uint8_t __div_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___div_uint8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_uint8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":32
 * cdef inline uint8_t __div_uint8_t(uint8_t a, uint8_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 32, __pyx_L1_error)
  }
  else if (sizeof(int) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 32, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div_int(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":30
 * 
 * 
 * cdef inline uint8_t __div_uint8_t(uint8_t a, uint8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":47
 * 
 * 
 * cdef inline uint16_t __add_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___add_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_uint16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":49
 * cdef inline uint16_t __add_uint16_t(uint16_t a, uint16_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":47
 * 
 * 
 * cdef inline uint16_t __add_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":52
 * 
 * 
 * cdef inline uint16_t __sub_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_uint16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":54
 * cdef inline uint16_t __sub_uint16_t(uint16_t a, uint16_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":52
 * 
 * 
 * cdef inline uint16_t __sub_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":57
 * 
 * 
 * cdef inline uint16_t __mul_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_uint16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":59
 * cdef inline uint16_t __mul_uint16_t(uint16_t a, uint16_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":57
 * 
 * 
 * cdef inline uint16_t __mul_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":62
 * 
 * 
 * cdef inline uint16_t __div_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___div_uint16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_uint16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":64
 * cdef inline uint16_t __div_uint16_t(uint16_t a, uint16_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 64, __pyx_L1_error)
  }
  else if (sizeof(int) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 64, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div_int(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":62
 * 
 * 
 * cdef inline uint16_t __div_uint16_t(uint16_t a, uint16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":79
 * 
 * 
 * cdef inline uint32_t __add_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___add_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_uint32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":81
 * cdef inline uint32_t __add_uint32_t(uint32_t a, uint32_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":79
 * 
 * 
 * cdef inline uint32_t __add_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":84
 * 
 * 
 * cdef inline uint32_t __sub_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_uint32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":86
 * cdef inline uint32_t __sub_uint32_t(uint32_t a, uint32_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":84
 * 
 * 
 * cdef inline uint32_t __sub_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":89
 * 
 * 
 * cdef inline uint32_t __mul_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_uint32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":91
 * cdef inline uint32_t __mul_uint32_t(uint32_t a, uint32_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":89
 * 
 * 
 * cdef inline uint32_t __mul_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":94
 * 
 * 
 * cdef inline uint32_t __div_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___div_uint32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_uint32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":96
 * cdef inline uint32_t __div_uint32_t(uint32_t a, uint32_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 96, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":94
 * 
 * 
 * cdef inline uint32_t __div_uint32_t(uint32_t a, uint32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":111
 * 
 * 
 * cdef inline uint64_t __add_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___add_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_uint64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":113
 * cdef inline uint64_t __add_uint64_t(uint64_t a, uint64_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":111
 * 
 * 
 * cdef inline uint64_t __add_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":116
 * 
 * 
 * cdef inline uint64_t __sub_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_uint64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":118
 * cdef inline uint64_t __sub_uint64_t(uint64_t a, uint64_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":116
 * 
 * 
 * cdef inline uint64_t __sub_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":121
 * 
 * 
 * cdef inline uint64_t __mul_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_uint64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":123
 * cdef inline uint64_t __mul_uint64_t(uint64_t a, uint64_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":121
 * 
 * 
 * cdef inline uint64_t __mul_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":126
 * 
 * 
 * cdef inline uint64_t __div_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___div_uint64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_uint64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":128
 * cdef inline uint64_t __div_uint64_t(uint64_t a, uint64_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 128, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":126
 * 
 * 
 * cdef inline uint64_t __div_uint64_t(uint64_t a, uint64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":143
 * 
 * 
 * cdef inline uint96_t __add_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___add_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_uint96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":145
 * cdef inline uint96_t __add_uint96_t(uint96_t a, uint96_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":143
 * 
 * 
 * cdef inline uint96_t __add_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":148
 * 
 * 
 * cdef inline uint96_t __sub_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_uint96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":150
 * cdef inline uint96_t __sub_uint96_t(uint96_t a, uint96_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":148
 * 
 * 
 * cdef inline uint96_t __sub_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":153
 * 
 * 
 * cdef inline uint96_t __mul_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_uint96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":155
 * cdef inline uint96_t __mul_uint96_t(uint96_t a, uint96_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":153
 * 
 * 
 * cdef inline uint96_t __mul_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":158
 * 
 * 
 * cdef inline uint96_t __div_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___div_uint96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_uint96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":160
 * cdef inline uint96_t __div_uint96_t(uint96_t a, uint96_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 160, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":158
 * 
 * 
 * cdef inline uint96_t __div_uint96_t(uint96_t a, uint96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":175
 * 
 * 
 * cdef inline uint128_t __add_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___add_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_uint128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":177
 * cdef inline uint128_t __add_uint128_t(uint128_t a, uint128_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":175
 * 
 * 
 * cdef inline uint128_t __add_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":180
 * 
 * 
 * cdef inline uint128_t __sub_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___sub_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_uint128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":182
 * cdef inline uint128_t __sub_uint128_t(uint128_t a, uint128_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":180
 * 
 * 
 * cdef inline uint128_t __sub_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":185
 * 
 * 
 * cdef inline uint128_t __mul_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___mul_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_uint128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":187
 * cdef inline uint128_t __mul_uint128_t(uint128_t a, uint128_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":185
 * 
 * 
 * cdef inline uint128_t __mul_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":190
 * 
 * 
 * cdef inline uint128_t __div_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___div_uint128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_uint128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":192
 * cdef inline uint128_t __div_uint128_t(uint128_t a, uint128_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 192, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":190
 * 
 * 
 * cdef inline uint128_t __div_uint128_t(uint128_t a, uint128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":207
 * 
 * 
 * cdef inline int8_t __add_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___add_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_int8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":209
 * cdef inline int8_t __add_int8_t(int8_t a, int8_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":207
 * 
 * 
 * cdef inline int8_t __add_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":212
 * 
 * 
 * cdef inline int8_t __sub_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___sub_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_int8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":214
 * cdef inline int8_t __sub_int8_t(int8_t a, int8_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":212
 * 
 * 
 * cdef inline int8_t __sub_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":217
 * 
 * 
 * cdef inline int8_t __mul_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___mul_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_int8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":219
 * cdef inline int8_t __mul_int8_t(int8_t a, int8_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":217
 * 
 * 
 * cdef inline int8_t __mul_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":222
 * 
 * 
 * cdef inline int8_t __div_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___div_int8_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_int8_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":224
 * cdef inline int8_t __div_int8_t(int8_t a, int8_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 224, __pyx_L1_error)
  }
  else if (sizeof(int) == sizeof(long) && unlikely(__pyx_v_b == -1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 224, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div_int(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":222
 * 
 * 
 * cdef inline int8_t __div_int8_t(int8_t a, int8_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":239
 * 
 * 
 * cdef inline int16_t __add_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___add_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_int16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":241
 * cdef inline int16_t __add_int16_t(int16_t a, int16_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":239
 * 
 * 
 * cdef inline int16_t __add_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":244
 * 
 * 
 * cdef inline int16_t __sub_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___sub_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_int16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":246
 * cdef inline int16_t __sub_int16_t(int16_t a, int16_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":244
 * 
 * 
 * cdef inline int16_t __sub_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":249
 * 
 * 
 * cdef inline int16_t __mul_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___mul_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_int16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":251
 * cdef inline int16_t __mul_int16_t(int16_t a, int16_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":249
 * 
 * 
 * cdef inline int16_t __mul_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":254
 * 
 * 
 * cdef inline int16_t __div_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___div_int16_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_int16_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":256
 * cdef inline int16_t __div_int16_t(int16_t a, int16_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 256, __pyx_L1_error)
  }
  else if (sizeof(int) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 256, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div_int(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":254
 * 
 * 
 * cdef inline int16_t __div_int16_t(int16_t a, int16_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":271
 * 
 * 
 * cdef inline int32_t __add_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___add_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_int32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":273
 * cdef inline int32_t __add_int32_t(int32_t a, int32_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":271
 * 
 * 
 * cdef inline int32_t __add_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":276
 * 
 * 
 * cdef inline int32_t __sub_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___sub_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_int32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":278
 * cdef inline int32_t __sub_int32_t(int32_t a, int32_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":276
 * 
 * 
 * cdef inline int32_t __sub_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":281
 * 
 * 
 * cdef inline int32_t __mul_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___mul_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_int32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":283
 * cdef inline int32_t __mul_int32_t(int32_t a, int32_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":281
 * 
 * 
 * cdef inline int32_t __mul_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":286
 * 
 * 
 * cdef inline int32_t __div_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___div_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_int32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":288
 * cdef inline int32_t __div_int32_t(int32_t a, int32_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 288, __pyx_L1_error)
  }
  else if (sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 288, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":286
 * 
 * 
 * cdef inline int32_t __div_int32_t(int32_t a, int32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":303
 * 
 * 
 * cdef inline int64_t __add_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___add_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_int64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":305
 * cdef inline int64_t __add_int64_t(int64_t a, int64_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":303
 * 
 * 
 * cdef inline int64_t __add_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":308
 * 
 * 
 * cdef inline int64_t __sub_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___sub_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_int64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":310
 * cdef inline int64_t __sub_int64_t(int64_t a, int64_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":308
 * 
 * 
 * cdef inline int64_t __sub_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":313
 * 
 * 
 * cdef inline int64_t __mul_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___mul_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_int64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":315
 * cdef inline int64_t __mul_int64_t(int64_t a, int64_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":313
 * 
 * 
 * cdef inline int64_t __mul_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":318
 * 
 * 
 * cdef inline int64_t __div_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___div_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_int64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":320
 * cdef inline int64_t __div_int64_t(int64_t a, int64_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 320, __pyx_L1_error)
  }
  else if (sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 320, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":318
 * 
 * 
 * cdef inline int64_t __div_int64_t(int64_t a, int64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":335
 * 
 * 
 * cdef inline int96_t __add_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___add_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_int96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":337
 * cdef inline int96_t __add_int96_t(int96_t a, int96_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":335
 * 
 * 
 * cdef inline int96_t __add_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":340
 * 
 * 
 * cdef inline int96_t __sub_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___sub_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_int96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":342
 * cdef inline int96_t __sub_int96_t(int96_t a, int96_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":340
 * 
 * 
 * cdef inline int96_t __sub_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":345
 * 
 * 
 * cdef inline int96_t __mul_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___mul_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_int96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":347
 * cdef inline int96_t __mul_int96_t(int96_t a, int96_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":345
 * 
 * 
 * cdef inline int96_t __mul_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":350
 * 
 * 
 * cdef inline int96_t __div_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___div_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_int96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":352
 * cdef inline int96_t __div_int96_t(int96_t a, int96_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 352, __pyx_L1_error)
  }
  else if (sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 352, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":350
 * 
 * 
 * cdef inline int96_t __div_int96_t(int96_t a, int96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":367
 * 
 * 
 * cdef inline int128_t __add_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___add_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_int128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":369
 * cdef inline int128_t __add_int128_t(int128_t a, int128_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":367
 * 
 * 
 * cdef inline int128_t __add_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":372
 * 
 * 
 * cdef inline int128_t __sub_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___sub_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_int128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":374
 * cdef inline int128_t __sub_int128_t(int128_t a, int128_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":372
 * 
 * 
 * cdef inline int128_t __sub_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":377
 * 
 * 
 * cdef inline int128_t __mul_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___mul_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_int128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":379
 * cdef inline int128_t __mul_int128_t(int128_t a, int128_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":377
 * 
 * 
 * cdef inline int128_t __mul_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":382
 * 
 * 
 * cdef inline int128_t __div_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___div_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_int128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":384
 * cdef inline int128_t __div_int128_t(int128_t a, int128_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
    __PYX_ERR(6, 384, __pyx_L1_error)
  }
  else if (sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t) == sizeof(long) && (!(((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)-1) > 0)) && unlikely(__pyx_v_b == (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)-1)  && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_a))) {
    PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
    __PYX_ERR(6, 384, __pyx_L1_error)
  }
  __pyx_r = __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t(__pyx_v_a, __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":382
 * 
 * 
 * cdef inline int128_t __div_int128_t(int128_t a, int128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":399
 * 
 * 
 * cdef inline float32_t __add_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___add_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_float32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":401
 * cdef inline float32_t __add_float32_t(float32_t a, float32_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":399
 * 
 * 
 * cdef inline float32_t __add_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":404
 * 
 * 
 * cdef inline float32_t __sub_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___sub_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_float32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":406
 * cdef inline float32_t __sub_float32_t(float32_t a, float32_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":404
 * 
 * 
 * cdef inline float32_t __sub_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":409
 * 
 * 
 * cdef inline float32_t __mul_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___mul_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_float32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":411
 * cdef inline float32_t __mul_float32_t(float32_t a, float32_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":409
 * 
 * 
 * cdef inline float32_t __mul_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":414
 * 
 * 
 * cdef inline float32_t __div_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___div_float32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_float32_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":416
 * cdef inline float32_t __div_float32_t(float32_t a, float32_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(6, 416, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":414
 * 
 * 
 * cdef inline float32_t __div_float32_t(float32_t a, float32_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":431
 * 
 * 
 * cdef inline float64_t __add_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___add_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_float64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":433
 * cdef inline float64_t __add_float64_t(float64_t a, float64_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":431
 * 
 * 
 * cdef inline float64_t __add_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":436
 * 
 * 
 * cdef inline float64_t __sub_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___sub_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_float64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":438
 * cdef inline float64_t __sub_float64_t(float64_t a, float64_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":436
 * 
 * 
 * cdef inline float64_t __sub_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":441
 * 
 * 
 * cdef inline float64_t __mul_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___mul_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_float64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":443
 * cdef inline float64_t __mul_float64_t(float64_t a, float64_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":441
 * 
 * 
 * cdef inline float64_t __mul_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":446
 * 
 * 
 * cdef inline float64_t __div_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___div_float64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_float64_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":448
 * cdef inline float64_t __div_float64_t(float64_t a, float64_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(6, 448, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":446
 * 
 * 
 * cdef inline float64_t __div_float64_t(float64_t a, float64_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":463
 * 
 * 
 * cdef inline float80_t __add_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___add_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_float80_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":465
 * cdef inline float80_t __add_float80_t(float80_t a, float80_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":463
 * 
 * 
 * cdef inline float80_t __add_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":468
 * 
 * 
 * cdef inline float80_t __sub_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___sub_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_float80_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":470
 * cdef inline float80_t __sub_float80_t(float80_t a, float80_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":468
 * 
 * 
 * cdef inline float80_t __sub_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":473
 * 
 * 
 * cdef inline float80_t __mul_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___mul_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_float80_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":475
 * cdef inline float80_t __mul_float80_t(float80_t a, float80_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":473
 * 
 * 
 * cdef inline float80_t __mul_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":478
 * 
 * 
 * cdef inline float80_t __div_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___div_float80_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_float80_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":480
 * cdef inline float80_t __div_float80_t(float80_t a, float80_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(6, 480, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":478
 * 
 * 
 * cdef inline float80_t __div_float80_t(float80_t a, float80_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":495
 * 
 * 
 * cdef inline float96_t __add_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___add_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_float96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":497
 * cdef inline float96_t __add_float96_t(float96_t a, float96_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":495
 * 
 * 
 * cdef inline float96_t __add_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":500
 * 
 * 
 * cdef inline float96_t __sub_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___sub_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_float96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":502
 * cdef inline float96_t __sub_float96_t(float96_t a, float96_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":500
 * 
 * 
 * cdef inline float96_t __sub_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":505
 * 
 * 
 * cdef inline float96_t __mul_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___mul_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_float96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":507
 * cdef inline float96_t __mul_float96_t(float96_t a, float96_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":505
 * 
 * 
 * cdef inline float96_t __mul_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":510
 * 
 * 
 * cdef inline float96_t __div_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___div_float96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_float96_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":512
 * cdef inline float96_t __div_float96_t(float96_t a, float96_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(6, 512, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":510
 * 
 * 
 * cdef inline float96_t __div_float96_t(float96_t a, float96_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":527
 * 
 * 
 * cdef inline float128_t __add_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___add_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add_float128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":529
 * cdef inline float128_t __add_float128_t(float128_t a, float128_t b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a + __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":527
 * 
 * 
 * cdef inline float128_t __add_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":532
 * 
 * 
 * cdef inline float128_t __sub_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___sub_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub_float128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":534
 * cdef inline float128_t __sub_float128_t(float128_t a, float128_t b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a - __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":532
 * 
 * 
 * cdef inline float128_t __sub_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":537
 * 
 * 
 * cdef inline float128_t __mul_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___mul_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul_float128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":539
 * cdef inline float128_t __mul_float128_t(float128_t a, float128_t b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (__pyx_v_a * __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":537
 * 
 * 
 * cdef inline float128_t __mul_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

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

/* "redblackpy/cython_source/arithmetic.pxi":542
 * 
 * 
 * cdef inline float128_t __div_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___div_float128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_b) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div_float128_t", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":544
 * cdef inline float128_t __div_float128_t(float128_t a, float128_t b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  if (unlikely(__pyx_v_b == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(6, 544, __pyx_L1_error)
  }
  __pyx_r = (__pyx_v_a / __pyx_v_b);
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":542
 * 
 * 
 * cdef inline float128_t __div_float128_t(float128_t a, float128_t b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__div_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":559
 * 
 * 
 * cdef inline object __add_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___add_object(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__add_object", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":561
 * cdef inline object __add_object(object a, object b):
 * 
 *     return a + b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Add(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":559
 * 
 * 
 * cdef inline object __add_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a + b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__add_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":564
 * 
 * 
 * cdef inline object __sub_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___sub_object(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__sub_object", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":566
 * cdef inline object __sub_object(object a, object b):
 * 
 *     return a - b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":564
 * 
 * 
 * cdef inline object __sub_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a - b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__sub_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":569
 * 
 * 
 * cdef inline object __mul_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___mul_object(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__mul_object", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":571
 * cdef inline object __mul_object(object a, object b):
 * 
 *     return a * b             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":569
 * 
 * 
 * cdef inline object __mul_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a * b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__mul_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/arithmetic.pxi":574
 * 
 * 
 * cdef inline object __div_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___div_object(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__div_object", 0);

  /* "redblackpy/cython_source/arithmetic.pxi":576
 * cdef inline object __div_object(object a, object b):
 * 
 *     return a / b             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(6, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/arithmetic.pxi":574
 * 
 * 
 * cdef inline object __div_object(object a, object b):             # <<<<<<<<<<<<<<
 * 
 *     return a / b
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__div_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":7
 * 
 * 
 * cdef inline uint8_t __deref_value_ptr_uint8_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint8_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_uint8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":9
 * cdef inline uint8_t __deref_value_ptr_uint8_t(node_ptr node):
 * 
 *     return deref( <uint8_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":7
 * 
 * 
 * cdef inline uint8_t __deref_value_ptr_uint8_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint8_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":12
 * 
 * 
 * cdef inline void __insert_node_uint8_t(rb_tree_ptr& index, key, uint8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint8_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_uint8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":14
 * cdef inline void __insert_node_uint8_t(rb_tree_ptr& index, key, uint8_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint8_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint8_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":16
 *     cdef void* address = malloc( sizeof(uint8_t) )
 *     # assign new value and insert node with address
 *     (<uint8_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":17
 *     # assign new value and insert node with address
 *     (<uint8_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 17, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 17, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":12
 * 
 * 
 * cdef inline void __insert_node_uint8_t(rb_tree_ptr& index, key, uint8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint8_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":20
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint8_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint8_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_uint8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":23
 *                                         		key, uint8_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint8_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint8_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":25
 *     cdef void* address = malloc( sizeof(uint8_t) )
 *     # assign new value and insert node with address
 *     (<uint8_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":26
 *     # assign new value and insert node with address
 *     (<uint8_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 26, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 26, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":20
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint8_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint8_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":29
 * 
 * 
 * cdef void __erase_node_uint8_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_uint8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":31
 * cdef void __erase_node_uint8_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":32
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 32, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":34
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":36
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":37
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":36
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":39
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":40
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 40, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":34
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":29
 * 
 * 
 * cdef void __erase_node_uint8_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_uint8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":43
 * 
 * 
 * cdef inline void __set_value_uint8_t(node_ptr node, uint8_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":45
 * cdef inline void __set_value_uint8_t(node_ptr node, uint8_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint8_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":46
 * 
 *     if deref(node).value != NULL:
 *         (<uint8_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":45
 * cdef inline void __set_value_uint8_t(node_ptr node, uint8_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint8_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":49
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(uint8_t) )             # <<<<<<<<<<<<<<
 *         (<uint8_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":50
 *     else:
 *         deref(node).value = malloc( sizeof(uint8_t) )
 *         (<uint8_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":43
 * 
 * 
 * cdef inline void __set_value_uint8_t(node_ptr node, uint8_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":53
 * 
 * 
 * cdef inline void __dealloc_value_uint8_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_uint8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":55
 * cdef inline void __dealloc_value_uint8_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":56
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":55
 * cdef inline void __dealloc_value_uint8_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":53
 * 
 * 
 * cdef inline void __dealloc_value_uint8_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":65
 * 
 * 
 * cdef inline uint16_t __deref_value_ptr_uint16_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint16_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_uint16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":67
 * cdef inline uint16_t __deref_value_ptr_uint16_t(node_ptr node):
 * 
 *     return deref( <uint16_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":65
 * 
 * 
 * cdef inline uint16_t __deref_value_ptr_uint16_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint16_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":70
 * 
 * 
 * cdef inline void __insert_node_uint16_t(rb_tree_ptr& index, key, uint16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint16_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_uint16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":72
 * cdef inline void __insert_node_uint16_t(rb_tree_ptr& index, key, uint16_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint16_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint16_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":74
 *     cdef void* address = malloc( sizeof(uint16_t) )
 *     # assign new value and insert node with address
 *     (<uint16_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":75
 *     # assign new value and insert node with address
 *     (<uint16_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 75, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 75, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":70
 * 
 * 
 * cdef inline void __insert_node_uint16_t(rb_tree_ptr& index, key, uint16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint16_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":78
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint16_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint16_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_uint16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":81
 *                                         		key, uint16_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint16_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint16_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":83
 *     cdef void* address = malloc( sizeof(uint16_t) )
 *     # assign new value and insert node with address
 *     (<uint16_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":84
 *     # assign new value and insert node with address
 *     (<uint16_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 84, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 84, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":78
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint16_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint16_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":87
 * 
 * 
 * cdef void __erase_node_uint16_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_uint16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":89
 * cdef void __erase_node_uint16_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":90
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 90, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":92
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":94
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":95
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":94
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":97
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":98
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 98, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":92
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":87
 * 
 * 
 * cdef void __erase_node_uint16_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_uint16_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":101
 * 
 * 
 * cdef inline void __set_value_uint16_t(node_ptr node, uint16_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":103
 * cdef inline void __set_value_uint16_t(node_ptr node, uint16_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint16_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":104
 * 
 *     if deref(node).value != NULL:
 *         (<uint16_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":103
 * cdef inline void __set_value_uint16_t(node_ptr node, uint16_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint16_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":107
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(uint16_t) )             # <<<<<<<<<<<<<<
 *         (<uint16_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":108
 *     else:
 *         deref(node).value = malloc( sizeof(uint16_t) )
 *         (<uint16_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":101
 * 
 * 
 * cdef inline void __set_value_uint16_t(node_ptr node, uint16_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":111
 * 
 * 
 * cdef inline void __dealloc_value_uint16_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_uint16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":113
 * cdef inline void __dealloc_value_uint16_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":114
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":113
 * cdef inline void __dealloc_value_uint16_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":111
 * 
 * 
 * cdef inline void __dealloc_value_uint16_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":123
 * 
 * 
 * cdef inline uint32_t __deref_value_ptr_uint32_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint32_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_uint32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":125
 * cdef inline uint32_t __deref_value_ptr_uint32_t(node_ptr node):
 * 
 *     return deref( <uint32_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":123
 * 
 * 
 * cdef inline uint32_t __deref_value_ptr_uint32_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint32_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":128
 * 
 * 
 * cdef inline void __insert_node_uint32_t(rb_tree_ptr& index, key, uint32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint32_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_uint32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":130
 * cdef inline void __insert_node_uint32_t(rb_tree_ptr& index, key, uint32_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint32_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint32_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":132
 *     cdef void* address = malloc( sizeof(uint32_t) )
 *     # assign new value and insert node with address
 *     (<uint32_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":133
 *     # assign new value and insert node with address
 *     (<uint32_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 133, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 133, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":128
 * 
 * 
 * cdef inline void __insert_node_uint32_t(rb_tree_ptr& index, key, uint32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint32_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":136
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint32_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint32_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_uint32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":139
 *                                         		key, uint32_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint32_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint32_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":141
 *     cdef void* address = malloc( sizeof(uint32_t) )
 *     # assign new value and insert node with address
 *     (<uint32_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":142
 *     # assign new value and insert node with address
 *     (<uint32_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 142, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 142, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":136
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint32_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint32_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":145
 * 
 * 
 * cdef void __erase_node_uint32_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_uint32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":147
 * cdef void __erase_node_uint32_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":148
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 148, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":150
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":152
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":153
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":152
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":155
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":156
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 156, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":150
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":145
 * 
 * 
 * cdef void __erase_node_uint32_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_uint32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":159
 * 
 * 
 * cdef inline void __set_value_uint32_t(node_ptr node, uint32_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":161
 * cdef inline void __set_value_uint32_t(node_ptr node, uint32_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint32_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":162
 * 
 *     if deref(node).value != NULL:
 *         (<uint32_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":161
 * cdef inline void __set_value_uint32_t(node_ptr node, uint32_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint32_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":165
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(uint32_t) )             # <<<<<<<<<<<<<<
 *         (<uint32_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":166
 *     else:
 *         deref(node).value = malloc( sizeof(uint32_t) )
 *         (<uint32_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":159
 * 
 * 
 * cdef inline void __set_value_uint32_t(node_ptr node, uint32_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":169
 * 
 * 
 * cdef inline void __dealloc_value_uint32_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_uint32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":171
 * cdef inline void __dealloc_value_uint32_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":172
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":171
 * cdef inline void __dealloc_value_uint32_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":169
 * 
 * 
 * cdef inline void __dealloc_value_uint32_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":181
 * 
 * 
 * cdef inline uint64_t __deref_value_ptr_uint64_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint64_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_uint64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":183
 * cdef inline uint64_t __deref_value_ptr_uint64_t(node_ptr node):
 * 
 *     return deref( <uint64_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":181
 * 
 * 
 * cdef inline uint64_t __deref_value_ptr_uint64_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint64_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":186
 * 
 * 
 * cdef inline void __insert_node_uint64_t(rb_tree_ptr& index, key, uint64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint64_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_uint64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":188
 * cdef inline void __insert_node_uint64_t(rb_tree_ptr& index, key, uint64_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint64_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint64_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":190
 *     cdef void* address = malloc( sizeof(uint64_t) )
 *     # assign new value and insert node with address
 *     (<uint64_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":191
 *     # assign new value and insert node with address
 *     (<uint64_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 191, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 191, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":186
 * 
 * 
 * cdef inline void __insert_node_uint64_t(rb_tree_ptr& index, key, uint64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint64_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":194
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint64_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint64_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_uint64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":197
 *                                         		key, uint64_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint64_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint64_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":199
 *     cdef void* address = malloc( sizeof(uint64_t) )
 *     # assign new value and insert node with address
 *     (<uint64_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":200
 *     # assign new value and insert node with address
 *     (<uint64_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 200, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 200, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":194
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint64_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint64_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":203
 * 
 * 
 * cdef void __erase_node_uint64_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_uint64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":205
 * cdef void __erase_node_uint64_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":206
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 206, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":208
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":210
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":211
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":210
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":213
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":214
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 214, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":208
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":203
 * 
 * 
 * cdef void __erase_node_uint64_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_uint64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":217
 * 
 * 
 * cdef inline void __set_value_uint64_t(node_ptr node, uint64_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":219
 * cdef inline void __set_value_uint64_t(node_ptr node, uint64_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint64_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":220
 * 
 *     if deref(node).value != NULL:
 *         (<uint64_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":219
 * cdef inline void __set_value_uint64_t(node_ptr node, uint64_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint64_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":223
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(uint64_t) )             # <<<<<<<<<<<<<<
 *         (<uint64_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":224
 *     else:
 *         deref(node).value = malloc( sizeof(uint64_t) )
 *         (<uint64_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":217
 * 
 * 
 * cdef inline void __set_value_uint64_t(node_ptr node, uint64_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":227
 * 
 * 
 * cdef inline void __dealloc_value_uint64_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_uint64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":229
 * cdef inline void __dealloc_value_uint64_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":230
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":229
 * cdef inline void __dealloc_value_uint64_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":227
 * 
 * 
 * cdef inline void __dealloc_value_uint64_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":239
 * 
 * 
 * cdef inline uint96_t __deref_value_ptr_uint96_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint96_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_uint96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":241
 * cdef inline uint96_t __deref_value_ptr_uint96_t(node_ptr node):
 * 
 *     return deref( <uint96_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":239
 * 
 * 
 * cdef inline uint96_t __deref_value_ptr_uint96_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint96_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":244
 * 
 * 
 * cdef inline void __insert_node_uint96_t(rb_tree_ptr& index, key, uint96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint96_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_uint96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":246
 * cdef inline void __insert_node_uint96_t(rb_tree_ptr& index, key, uint96_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint96_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint96_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":248
 *     cdef void* address = malloc( sizeof(uint96_t) )
 *     # assign new value and insert node with address
 *     (<uint96_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":249
 *     # assign new value and insert node with address
 *     (<uint96_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 249, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 249, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":244
 * 
 * 
 * cdef inline void __insert_node_uint96_t(rb_tree_ptr& index, key, uint96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint96_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":252
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint96_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint96_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_uint96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":255
 *                                         		key, uint96_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint96_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint96_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":257
 *     cdef void* address = malloc( sizeof(uint96_t) )
 *     # assign new value and insert node with address
 *     (<uint96_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":258
 *     # assign new value and insert node with address
 *     (<uint96_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 258, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 258, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":252
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint96_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint96_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":261
 * 
 * 
 * cdef void __erase_node_uint96_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_uint96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":263
 * cdef void __erase_node_uint96_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":264
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 264, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":266
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":268
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":269
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":268
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":271
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":272
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 272, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":266
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":261
 * 
 * 
 * cdef void __erase_node_uint96_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_uint96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":275
 * 
 * 
 * cdef inline void __set_value_uint96_t(node_ptr node, uint96_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":277
 * cdef inline void __set_value_uint96_t(node_ptr node, uint96_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint96_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":278
 * 
 *     if deref(node).value != NULL:
 *         (<uint96_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":277
 * cdef inline void __set_value_uint96_t(node_ptr node, uint96_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint96_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":281
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(uint96_t) )             # <<<<<<<<<<<<<<
 *         (<uint96_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":282
 *     else:
 *         deref(node).value = malloc( sizeof(uint96_t) )
 *         (<uint96_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":275
 * 
 * 
 * cdef inline void __set_value_uint96_t(node_ptr node, uint96_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":285
 * 
 * 
 * cdef inline void __dealloc_value_uint96_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_uint96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":287
 * cdef inline void __dealloc_value_uint96_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":288
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":287
 * cdef inline void __dealloc_value_uint96_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":285
 * 
 * 
 * cdef inline void __dealloc_value_uint96_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":297
 * 
 * 
 * cdef inline uint128_t __deref_value_ptr_uint128_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint128_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_uint128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":299
 * cdef inline uint128_t __deref_value_ptr_uint128_t(node_ptr node):
 * 
 *     return deref( <uint128_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":297
 * 
 * 
 * cdef inline uint128_t __deref_value_ptr_uint128_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <uint128_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":302
 * 
 * 
 * cdef inline void __insert_node_uint128_t(rb_tree_ptr& index, key, uint128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint128_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_uint128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":304
 * cdef inline void __insert_node_uint128_t(rb_tree_ptr& index, key, uint128_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint128_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint128_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":306
 *     cdef void* address = malloc( sizeof(uint128_t) )
 *     # assign new value and insert node with address
 *     (<uint128_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":307
 *     # assign new value and insert node with address
 *     (<uint128_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 307, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 307, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":302
 * 
 * 
 * cdef inline void __insert_node_uint128_t(rb_tree_ptr& index, key, uint128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(uint128_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":310
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint128_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint128_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_uint128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":313
 *                                         		key, uint128_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(uint128_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<uint128_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":315
 *     cdef void* address = malloc( sizeof(uint128_t) )
 *     # assign new value and insert node with address
 *     (<uint128_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":316
 *     # assign new value and insert node with address
 *     (<uint128_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 316, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 316, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":310
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_uint128_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, uint128_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":319
 * 
 * 
 * cdef void __erase_node_uint128_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_uint128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":321
 * cdef void __erase_node_uint128_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":322
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 322, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":324
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":326
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":327
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":326
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":329
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":330
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 330, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":324
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":319
 * 
 * 
 * cdef void __erase_node_uint128_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_uint128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":333
 * 
 * 
 * cdef inline void __set_value_uint128_t(node_ptr node, uint128_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":335
 * cdef inline void __set_value_uint128_t(node_ptr node, uint128_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint128_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":336
 * 
 *     if deref(node).value != NULL:
 *         (<uint128_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":335
 * cdef inline void __set_value_uint128_t(node_ptr node, uint128_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<uint128_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":339
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(uint128_t) )             # <<<<<<<<<<<<<<
 *         (<uint128_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":340
 *     else:
 *         deref(node).value = malloc( sizeof(uint128_t) )
 *         (<uint128_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":333
 * 
 * 
 * cdef inline void __set_value_uint128_t(node_ptr node, uint128_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":343
 * 
 * 
 * cdef inline void __dealloc_value_uint128_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_uint128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":345
 * cdef inline void __dealloc_value_uint128_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":346
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":345
 * cdef inline void __dealloc_value_uint128_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":343
 * 
 * 
 * cdef inline void __dealloc_value_uint128_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":355
 * 
 * 
 * cdef inline int8_t __deref_value_ptr_int8_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int8_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_int8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":357
 * cdef inline int8_t __deref_value_ptr_int8_t(node_ptr node):
 * 
 *     return deref( <int8_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":355
 * 
 * 
 * cdef inline int8_t __deref_value_ptr_int8_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int8_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":360
 * 
 * 
 * cdef inline void __insert_node_int8_t(rb_tree_ptr& index, key, int8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int8_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_int8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":362
 * cdef inline void __insert_node_int8_t(rb_tree_ptr& index, key, int8_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(int8_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int8_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":364
 *     cdef void* address = malloc( sizeof(int8_t) )
 *     # assign new value and insert node with address
 *     (<int8_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":365
 *     # assign new value and insert node with address
 *     (<int8_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 365, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 365, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":360
 * 
 * 
 * cdef inline void __insert_node_int8_t(rb_tree_ptr& index, key, int8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int8_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":368
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int8_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int8_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_int8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":371
 *                                         		key, int8_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(int8_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int8_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":373
 *     cdef void* address = malloc( sizeof(int8_t) )
 *     # assign new value and insert node with address
 *     (<int8_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":374
 *     # assign new value and insert node with address
 *     (<int8_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 374, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 374, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":368
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int8_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int8_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":377
 * 
 * 
 * cdef void __erase_node_int8_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int8_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_int8_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":379
 * cdef void __erase_node_int8_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":380
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 380, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":382
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":384
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":385
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":384
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":387
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":388
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 388, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":382
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":377
 * 
 * 
 * cdef void __erase_node_int8_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_int8_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":391
 * 
 * 
 * cdef inline void __set_value_int8_t(node_ptr node, int8_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":393
 * cdef inline void __set_value_int8_t(node_ptr node, int8_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int8_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":394
 * 
 *     if deref(node).value != NULL:
 *         (<int8_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":393
 * cdef inline void __set_value_int8_t(node_ptr node, int8_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int8_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":397
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(int8_t) )             # <<<<<<<<<<<<<<
 *         (<int8_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":398
 *     else:
 *         deref(node).value = malloc( sizeof(int8_t) )
 *         (<int8_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":391
 * 
 * 
 * cdef inline void __set_value_int8_t(node_ptr node, int8_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":401
 * 
 * 
 * cdef inline void __dealloc_value_int8_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_int8_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":403
 * cdef inline void __dealloc_value_int8_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":404
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":403
 * cdef inline void __dealloc_value_int8_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":401
 * 
 * 
 * cdef inline void __dealloc_value_int8_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":413
 * 
 * 
 * cdef inline int16_t __deref_value_ptr_int16_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int16_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_int16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":415
 * cdef inline int16_t __deref_value_ptr_int16_t(node_ptr node):
 * 
 *     return deref( <int16_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":413
 * 
 * 
 * cdef inline int16_t __deref_value_ptr_int16_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int16_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":418
 * 
 * 
 * cdef inline void __insert_node_int16_t(rb_tree_ptr& index, key, int16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int16_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_int16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":420
 * cdef inline void __insert_node_int16_t(rb_tree_ptr& index, key, int16_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(int16_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int16_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":422
 *     cdef void* address = malloc( sizeof(int16_t) )
 *     # assign new value and insert node with address
 *     (<int16_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":423
 *     # assign new value and insert node with address
 *     (<int16_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 423, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 423, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":418
 * 
 * 
 * cdef inline void __insert_node_int16_t(rb_tree_ptr& index, key, int16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int16_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":426
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int16_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int16_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_int16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":429
 *                                         		key, int16_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(int16_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int16_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":431
 *     cdef void* address = malloc( sizeof(int16_t) )
 *     # assign new value and insert node with address
 *     (<int16_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":432
 *     # assign new value and insert node with address
 *     (<int16_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 432, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 432, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":426
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int16_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int16_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":435
 * 
 * 
 * cdef void __erase_node_int16_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int16_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_int16_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":437
 * cdef void __erase_node_int16_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":438
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 438, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":440
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":442
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":443
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":442
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":445
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":446
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 446, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":440
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":435
 * 
 * 
 * cdef void __erase_node_int16_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_int16_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":449
 * 
 * 
 * cdef inline void __set_value_int16_t(node_ptr node, int16_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":451
 * cdef inline void __set_value_int16_t(node_ptr node, int16_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int16_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":452
 * 
 *     if deref(node).value != NULL:
 *         (<int16_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":451
 * cdef inline void __set_value_int16_t(node_ptr node, int16_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int16_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":455
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(int16_t) )             # <<<<<<<<<<<<<<
 *         (<int16_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":456
 *     else:
 *         deref(node).value = malloc( sizeof(int16_t) )
 *         (<int16_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":449
 * 
 * 
 * cdef inline void __set_value_int16_t(node_ptr node, int16_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":459
 * 
 * 
 * cdef inline void __dealloc_value_int16_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_int16_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":461
 * cdef inline void __dealloc_value_int16_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":462
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":461
 * cdef inline void __dealloc_value_int16_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":459
 * 
 * 
 * cdef inline void __dealloc_value_int16_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":471
 * 
 * 
 * cdef inline int32_t __deref_value_ptr_int32_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int32_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_int32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":473
 * cdef inline int32_t __deref_value_ptr_int32_t(node_ptr node):
 * 
 *     return deref( <int32_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":471
 * 
 * 
 * cdef inline int32_t __deref_value_ptr_int32_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int32_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":476
 * 
 * 
 * cdef inline void __insert_node_int32_t(rb_tree_ptr& index, key, int32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int32_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_int32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":478
 * cdef inline void __insert_node_int32_t(rb_tree_ptr& index, key, int32_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(int32_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int32_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":480
 *     cdef void* address = malloc( sizeof(int32_t) )
 *     # assign new value and insert node with address
 *     (<int32_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":481
 *     # assign new value and insert node with address
 *     (<int32_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 481, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 481, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":476
 * 
 * 
 * cdef inline void __insert_node_int32_t(rb_tree_ptr& index, key, int32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int32_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":484
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int32_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int32_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_int32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":487
 *                                         		key, int32_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(int32_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int32_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":489
 *     cdef void* address = malloc( sizeof(int32_t) )
 *     # assign new value and insert node with address
 *     (<int32_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":490
 *     # assign new value and insert node with address
 *     (<int32_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 490, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 490, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":484
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int32_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int32_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":493
 * 
 * 
 * cdef void __erase_node_int32_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_int32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":495
 * cdef void __erase_node_int32_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":496
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 496, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":498
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":500
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":501
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":500
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":503
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":504
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 504, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":498
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":493
 * 
 * 
 * cdef void __erase_node_int32_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_int32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":507
 * 
 * 
 * cdef inline void __set_value_int32_t(node_ptr node, int32_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":509
 * cdef inline void __set_value_int32_t(node_ptr node, int32_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int32_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":510
 * 
 *     if deref(node).value != NULL:
 *         (<int32_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":509
 * cdef inline void __set_value_int32_t(node_ptr node, int32_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int32_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":513
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(int32_t) )             # <<<<<<<<<<<<<<
 *         (<int32_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":514
 *     else:
 *         deref(node).value = malloc( sizeof(int32_t) )
 *         (<int32_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":507
 * 
 * 
 * cdef inline void __set_value_int32_t(node_ptr node, int32_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":517
 * 
 * 
 * cdef inline void __dealloc_value_int32_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_int32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":519
 * cdef inline void __dealloc_value_int32_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":520
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":519
 * cdef inline void __dealloc_value_int32_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":517
 * 
 * 
 * cdef inline void __dealloc_value_int32_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":529
 * 
 * 
 * cdef inline int64_t __deref_value_ptr_int64_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int64_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_int64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":531
 * cdef inline int64_t __deref_value_ptr_int64_t(node_ptr node):
 * 
 *     return deref( <int64_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":529
 * 
 * 
 * cdef inline int64_t __deref_value_ptr_int64_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int64_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":534
 * 
 * 
 * cdef inline void __insert_node_int64_t(rb_tree_ptr& index, key, int64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int64_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_int64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":536
 * cdef inline void __insert_node_int64_t(rb_tree_ptr& index, key, int64_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(int64_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int64_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":538
 *     cdef void* address = malloc( sizeof(int64_t) )
 *     # assign new value and insert node with address
 *     (<int64_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":539
 *     # assign new value and insert node with address
 *     (<int64_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 539, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 539, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":534
 * 
 * 
 * cdef inline void __insert_node_int64_t(rb_tree_ptr& index, key, int64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int64_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":542
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int64_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int64_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_int64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":545
 *                                         		key, int64_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(int64_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int64_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":547
 *     cdef void* address = malloc( sizeof(int64_t) )
 *     # assign new value and insert node with address
 *     (<int64_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":548
 *     # assign new value and insert node with address
 *     (<int64_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 548, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 548, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":542
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int64_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int64_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":551
 * 
 * 
 * cdef void __erase_node_int64_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_int64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":553
 * cdef void __erase_node_int64_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":554
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 554, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":556
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":558
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":559
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":558
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":561
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":562
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 562, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":556
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":551
 * 
 * 
 * cdef void __erase_node_int64_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_int64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":565
 * 
 * 
 * cdef inline void __set_value_int64_t(node_ptr node, int64_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":567
 * cdef inline void __set_value_int64_t(node_ptr node, int64_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int64_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":568
 * 
 *     if deref(node).value != NULL:
 *         (<int64_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":567
 * cdef inline void __set_value_int64_t(node_ptr node, int64_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int64_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":571
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(int64_t) )             # <<<<<<<<<<<<<<
 *         (<int64_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":572
 *     else:
 *         deref(node).value = malloc( sizeof(int64_t) )
 *         (<int64_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":565
 * 
 * 
 * cdef inline void __set_value_int64_t(node_ptr node, int64_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":575
 * 
 * 
 * cdef inline void __dealloc_value_int64_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_int64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":577
 * cdef inline void __dealloc_value_int64_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":578
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":577
 * cdef inline void __dealloc_value_int64_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":575
 * 
 * 
 * cdef inline void __dealloc_value_int64_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":587
 * 
 * 
 * cdef inline int96_t __deref_value_ptr_int96_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int96_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_int96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":589
 * cdef inline int96_t __deref_value_ptr_int96_t(node_ptr node):
 * 
 *     return deref( <int96_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":587
 * 
 * 
 * cdef inline int96_t __deref_value_ptr_int96_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int96_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":592
 * 
 * 
 * cdef inline void __insert_node_int96_t(rb_tree_ptr& index, key, int96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int96_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_int96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":594
 * cdef inline void __insert_node_int96_t(rb_tree_ptr& index, key, int96_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(int96_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int96_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":596
 *     cdef void* address = malloc( sizeof(int96_t) )
 *     # assign new value and insert node with address
 *     (<int96_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":597
 *     # assign new value and insert node with address
 *     (<int96_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 597, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 597, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":592
 * 
 * 
 * cdef inline void __insert_node_int96_t(rb_tree_ptr& index, key, int96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int96_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":600
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int96_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int96_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_int96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":603
 *                                         		key, int96_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(int96_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int96_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":605
 *     cdef void* address = malloc( sizeof(int96_t) )
 *     # assign new value and insert node with address
 *     (<int96_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":606
 *     # assign new value and insert node with address
 *     (<int96_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 606, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 606, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":600
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int96_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int96_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":609
 * 
 * 
 * cdef void __erase_node_int96_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_int96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":611
 * cdef void __erase_node_int96_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":612
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 612, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":614
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":616
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":617
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":616
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":619
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":620
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 620, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":614
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":609
 * 
 * 
 * cdef void __erase_node_int96_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_int96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":623
 * 
 * 
 * cdef inline void __set_value_int96_t(node_ptr node, int96_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":625
 * cdef inline void __set_value_int96_t(node_ptr node, int96_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int96_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":626
 * 
 *     if deref(node).value != NULL:
 *         (<int96_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":625
 * cdef inline void __set_value_int96_t(node_ptr node, int96_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int96_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":629
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(int96_t) )             # <<<<<<<<<<<<<<
 *         (<int96_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":630
 *     else:
 *         deref(node).value = malloc( sizeof(int96_t) )
 *         (<int96_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":623
 * 
 * 
 * cdef inline void __set_value_int96_t(node_ptr node, int96_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":633
 * 
 * 
 * cdef inline void __dealloc_value_int96_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_int96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":635
 * cdef inline void __dealloc_value_int96_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":636
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":635
 * cdef inline void __dealloc_value_int96_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":633
 * 
 * 
 * cdef inline void __dealloc_value_int96_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":645
 * 
 * 
 * cdef inline int128_t __deref_value_ptr_int128_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int128_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_int128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":647
 * cdef inline int128_t __deref_value_ptr_int128_t(node_ptr node):
 * 
 *     return deref( <int128_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":645
 * 
 * 
 * cdef inline int128_t __deref_value_ptr_int128_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <int128_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":650
 * 
 * 
 * cdef inline void __insert_node_int128_t(rb_tree_ptr& index, key, int128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int128_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_int128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_int128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":652
 * cdef inline void __insert_node_int128_t(rb_tree_ptr& index, key, int128_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(int128_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int128_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":654
 *     cdef void* address = malloc( sizeof(int128_t) )
 *     # assign new value and insert node with address
 *     (<int128_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":655
 *     # assign new value and insert node with address
 *     (<int128_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 655, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 655, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":650
 * 
 * 
 * cdef inline void __insert_node_int128_t(rb_tree_ptr& index, key, int128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(int128_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":658
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int128_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int128_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_int128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":661
 *                                         		key, int128_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(int128_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<int128_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":663
 *     cdef void* address = malloc( sizeof(int128_t) )
 *     # assign new value and insert node with address
 *     (<int128_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":664
 *     # assign new value and insert node with address
 *     (<int128_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 664, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 664, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":658
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_int128_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, int128_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":667
 * 
 * 
 * cdef void __erase_node_int128_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_int128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_int128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":669
 * cdef void __erase_node_int128_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":670
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 670, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":672
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":674
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":675
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":674
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":677
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":678
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 678, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":672
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":667
 * 
 * 
 * cdef void __erase_node_int128_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_int128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":681
 * 
 * 
 * cdef inline void __set_value_int128_t(node_ptr node, int128_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":683
 * cdef inline void __set_value_int128_t(node_ptr node, int128_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int128_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":684
 * 
 *     if deref(node).value != NULL:
 *         (<int128_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":683
 * cdef inline void __set_value_int128_t(node_ptr node, int128_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<int128_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":687
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(int128_t) )             # <<<<<<<<<<<<<<
 *         (<int128_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":688
 *     else:
 *         deref(node).value = malloc( sizeof(int128_t) )
 *         (<int128_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":681
 * 
 * 
 * cdef inline void __set_value_int128_t(node_ptr node, int128_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":691
 * 
 * 
 * cdef inline void __dealloc_value_int128_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_int128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":693
 * cdef inline void __dealloc_value_int128_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":694
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":693
 * cdef inline void __dealloc_value_int128_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":691
 * 
 * 
 * cdef inline void __dealloc_value_int128_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":703
 * 
 * 
 * cdef inline float32_t __deref_value_ptr_float32_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float32_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_float32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":705
 * cdef inline float32_t __deref_value_ptr_float32_t(node_ptr node):
 * 
 *     return deref( <float32_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":703
 * 
 * 
 * cdef inline float32_t __deref_value_ptr_float32_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float32_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":708
 * 
 * 
 * cdef inline void __insert_node_float32_t(rb_tree_ptr& index, key, float32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float32_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_float32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":710
 * cdef inline void __insert_node_float32_t(rb_tree_ptr& index, key, float32_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(float32_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float32_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":712
 *     cdef void* address = malloc( sizeof(float32_t) )
 *     # assign new value and insert node with address
 *     (<float32_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":713
 *     # assign new value and insert node with address
 *     (<float32_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 713, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 713, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":708
 * 
 * 
 * cdef inline void __insert_node_float32_t(rb_tree_ptr& index, key, float32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float32_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":716
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float32_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float32_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_float32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":719
 *                                         		key, float32_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(float32_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float32_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":721
 *     cdef void* address = malloc( sizeof(float32_t) )
 *     # assign new value and insert node with address
 *     (<float32_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":722
 *     # assign new value and insert node with address
 *     (<float32_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 722, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 722, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":716
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float32_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float32_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":725
 * 
 * 
 * cdef void __erase_node_float32_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float32_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_float32_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":727
 * cdef void __erase_node_float32_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":728
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 728, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":730
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":732
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":733
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":732
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":735
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":736
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 736, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":730
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":725
 * 
 * 
 * cdef void __erase_node_float32_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_float32_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":739
 * 
 * 
 * cdef inline void __set_value_float32_t(node_ptr node, float32_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":741
 * cdef inline void __set_value_float32_t(node_ptr node, float32_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float32_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":742
 * 
 *     if deref(node).value != NULL:
 *         (<float32_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":741
 * cdef inline void __set_value_float32_t(node_ptr node, float32_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float32_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":745
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(float32_t) )             # <<<<<<<<<<<<<<
 *         (<float32_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":746
 *     else:
 *         deref(node).value = malloc( sizeof(float32_t) )
 *         (<float32_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":739
 * 
 * 
 * cdef inline void __set_value_float32_t(node_ptr node, float32_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":749
 * 
 * 
 * cdef inline void __dealloc_value_float32_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_float32_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":751
 * cdef inline void __dealloc_value_float32_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":752
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":751
 * cdef inline void __dealloc_value_float32_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":749
 * 
 * 
 * cdef inline void __dealloc_value_float32_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":761
 * 
 * 
 * cdef inline float64_t __deref_value_ptr_float64_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float64_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_float64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":763
 * cdef inline float64_t __deref_value_ptr_float64_t(node_ptr node):
 * 
 *     return deref( <float64_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":761
 * 
 * 
 * cdef inline float64_t __deref_value_ptr_float64_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float64_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":766
 * 
 * 
 * cdef inline void __insert_node_float64_t(rb_tree_ptr& index, key, float64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float64_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_float64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":768
 * cdef inline void __insert_node_float64_t(rb_tree_ptr& index, key, float64_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(float64_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float64_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":770
 *     cdef void* address = malloc( sizeof(float64_t) )
 *     # assign new value and insert node with address
 *     (<float64_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":771
 *     # assign new value and insert node with address
 *     (<float64_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 771, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 771, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":766
 * 
 * 
 * cdef inline void __insert_node_float64_t(rb_tree_ptr& index, key, float64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float64_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":774
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float64_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float64_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_float64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":777
 *                                         		key, float64_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(float64_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float64_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":779
 *     cdef void* address = malloc( sizeof(float64_t) )
 *     # assign new value and insert node with address
 *     (<float64_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":780
 *     # assign new value and insert node with address
 *     (<float64_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 780, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 780, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":774
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float64_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float64_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":783
 * 
 * 
 * cdef void __erase_node_float64_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float64_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_float64_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":785
 * cdef void __erase_node_float64_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":786
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 786, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":788
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":790
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":791
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":790
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":793
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":794
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 794, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":788
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":783
 * 
 * 
 * cdef void __erase_node_float64_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_float64_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":797
 * 
 * 
 * cdef inline void __set_value_float64_t(node_ptr node, float64_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":799
 * cdef inline void __set_value_float64_t(node_ptr node, float64_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float64_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":800
 * 
 *     if deref(node).value != NULL:
 *         (<float64_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":799
 * cdef inline void __set_value_float64_t(node_ptr node, float64_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float64_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":803
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(float64_t) )             # <<<<<<<<<<<<<<
 *         (<float64_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":804
 *     else:
 *         deref(node).value = malloc( sizeof(float64_t) )
 *         (<float64_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":797
 * 
 * 
 * cdef inline void __set_value_float64_t(node_ptr node, float64_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":807
 * 
 * 
 * cdef inline void __dealloc_value_float64_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_float64_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":809
 * cdef inline void __dealloc_value_float64_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":810
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":809
 * cdef inline void __dealloc_value_float64_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":807
 * 
 * 
 * cdef inline void __dealloc_value_float64_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":819
 * 
 * 
 * cdef inline float80_t __deref_value_ptr_float80_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float80_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_float80_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":821
 * cdef inline float80_t __deref_value_ptr_float80_t(node_ptr node):
 * 
 *     return deref( <float80_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":819
 * 
 * 
 * cdef inline float80_t __deref_value_ptr_float80_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float80_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":824
 * 
 * 
 * cdef inline void __insert_node_float80_t(rb_tree_ptr& index, key, float80_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float80_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float80_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_float80_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":826
 * cdef inline void __insert_node_float80_t(rb_tree_ptr& index, key, float80_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(float80_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float80_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":828
 *     cdef void* address = malloc( sizeof(float80_t) )
 *     # assign new value and insert node with address
 *     (<float80_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":829
 *     # assign new value and insert node with address
 *     (<float80_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 829, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 829, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":824
 * 
 * 
 * cdef inline void __insert_node_float80_t(rb_tree_ptr& index, key, float80_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float80_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":832
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float80_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float80_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float80_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_float80_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":835
 *                                         		key, float80_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(float80_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float80_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":837
 *     cdef void* address = malloc( sizeof(float80_t) )
 *     # assign new value and insert node with address
 *     (<float80_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":838
 *     # assign new value and insert node with address
 *     (<float80_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 838, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 838, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":832
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float80_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float80_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":841
 * 
 * 
 * cdef void __erase_node_float80_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float80_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_float80_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":843
 * cdef void __erase_node_float80_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":844
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 844, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":846
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":848
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":849
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":848
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":851
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":852
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 852, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":846
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":841
 * 
 * 
 * cdef void __erase_node_float80_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_float80_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":855
 * 
 * 
 * cdef inline void __set_value_float80_t(node_ptr node, float80_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":857
 * cdef inline void __set_value_float80_t(node_ptr node, float80_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float80_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":858
 * 
 *     if deref(node).value != NULL:
 *         (<float80_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":857
 * cdef inline void __set_value_float80_t(node_ptr node, float80_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float80_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":861
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(float80_t) )             # <<<<<<<<<<<<<<
 *         (<float80_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":862
 *     else:
 *         deref(node).value = malloc( sizeof(float80_t) )
 *         (<float80_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":855
 * 
 * 
 * cdef inline void __set_value_float80_t(node_ptr node, float80_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":865
 * 
 * 
 * cdef inline void __dealloc_value_float80_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_float80_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":867
 * cdef inline void __dealloc_value_float80_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":868
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":867
 * cdef inline void __dealloc_value_float80_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":865
 * 
 * 
 * cdef inline void __dealloc_value_float80_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":877
 * 
 * 
 * cdef inline float96_t __deref_value_ptr_float96_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float96_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_float96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":879
 * cdef inline float96_t __deref_value_ptr_float96_t(node_ptr node):
 * 
 *     return deref( <float96_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":877
 * 
 * 
 * cdef inline float96_t __deref_value_ptr_float96_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float96_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":882
 * 
 * 
 * cdef inline void __insert_node_float96_t(rb_tree_ptr& index, key, float96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float96_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_float96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":884
 * cdef inline void __insert_node_float96_t(rb_tree_ptr& index, key, float96_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(float96_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float96_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":886
 *     cdef void* address = malloc( sizeof(float96_t) )
 *     # assign new value and insert node with address
 *     (<float96_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":887
 *     # assign new value and insert node with address
 *     (<float96_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 887, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 887, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":882
 * 
 * 
 * cdef inline void __insert_node_float96_t(rb_tree_ptr& index, key, float96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float96_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":890
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float96_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float96_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_float96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":893
 *                                         		key, float96_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(float96_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float96_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":895
 *     cdef void* address = malloc( sizeof(float96_t) )
 *     # assign new value and insert node with address
 *     (<float96_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":896
 *     # assign new value and insert node with address
 *     (<float96_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 896, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 896, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":890
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float96_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float96_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":899
 * 
 * 
 * cdef void __erase_node_float96_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float96_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_float96_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":901
 * cdef void __erase_node_float96_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":902
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 902, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":904
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":906
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":907
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":906
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":909
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":910
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 910, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":904
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":899
 * 
 * 
 * cdef void __erase_node_float96_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_float96_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":913
 * 
 * 
 * cdef inline void __set_value_float96_t(node_ptr node, float96_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":915
 * cdef inline void __set_value_float96_t(node_ptr node, float96_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float96_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":916
 * 
 *     if deref(node).value != NULL:
 *         (<float96_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":915
 * cdef inline void __set_value_float96_t(node_ptr node, float96_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float96_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":919
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(float96_t) )             # <<<<<<<<<<<<<<
 *         (<float96_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":920
 *     else:
 *         deref(node).value = malloc( sizeof(float96_t) )
 *         (<float96_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":913
 * 
 * 
 * cdef inline void __set_value_float96_t(node_ptr node, float96_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":923
 * 
 * 
 * cdef inline void __dealloc_value_float96_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_float96_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":925
 * cdef inline void __dealloc_value_float96_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":926
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":925
 * cdef inline void __dealloc_value_float96_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":923
 * 
 * 
 * cdef inline void __dealloc_value_float96_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":935
 * 
 * 
 * cdef inline float128_t __deref_value_ptr_float128_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float128_t*>deref(node).value )
 */

static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__deref_value_ptr_float128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":937
 * cdef inline float128_t __deref_value_ptr_float128_t(node_ptr node):
 * 
 *     return deref( <float128_t*>deref(node).value )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = (*((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t *)(*__pyx_v_node).value));
  goto __pyx_L0;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":935
 * 
 * 
 * cdef inline float128_t __deref_value_ptr_float128_t(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return deref( <float128_t*>deref(node).value )
 */

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

/* "redblackpy/cython_source/dtype_tree_processing.pxi":940
 * 
 * 
 * cdef inline void __insert_node_float128_t(rb_tree_ptr& index, key, float128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float128_t) )
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_float128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_float128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":942
 * cdef inline void __insert_node_float128_t(rb_tree_ptr& index, key, float128_t value) except*:
 * 
 *     cdef void* address = malloc( sizeof(float128_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float128_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":944
 *     cdef void* address = malloc( sizeof(float128_t) )
 *     # assign new value and insert node with address
 *     (<float128_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":945
 *     # assign new value and insert node with address
 *     (<float128_t*>address)[0] = value
 *     index.insert( rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 945, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 945, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":940
 * 
 * 
 * cdef inline void __insert_node_float128_t(rb_tree_ptr& index, key, float128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef void* address = malloc( sizeof(float128_t) )
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":948
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float128_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float128_t value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value) {
  void *__pyx_v_address;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_float128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":951
 *                                         		key, float128_t value ) except*:
 * 
 *     cdef void* address = malloc( sizeof(float128_t) )             # <<<<<<<<<<<<<<
 *     # assign new value and insert node with address
 *     (<float128_t*>address)[0] = value
 */
  __pyx_v_address = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)));

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":953
 *     cdef void* address = malloc( sizeof(float128_t) )
 *     # assign new value and insert node with address
 *     (<float128_t*>address)[0] = value             # <<<<<<<<<<<<<<
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )
 * 
 */
  (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t *)__pyx_v_address)[0]) = __pyx_v_value;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":954
 *     # assign new value and insert node with address
 *     (<float128_t*>address)[0] = value
 *     index.insert( position, rb_node_valued(to_c_pyobject(key), address) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_v_address);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(7, 954, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 954, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":948
 * 
 * 
 * cdef inline  void __insert_node_by_ptr_float128_t( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                         		key, float128_t value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":957
 * 
 * 
 * cdef void __erase_node_float128_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_float128_t(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_float128_t", 0);

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":959
 * cdef void __erase_node_float128_t(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":960
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(7, 960, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":962
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":964
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    __pyx_t_3 = (((*__pyx_v_node).value != NULL) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":965
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 *             free(deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
      free((*__pyx_v_node).value);

      /* "redblackpy/cython_source/dtype_tree_processing.pxi":964
 *     if ( node != index.link() ):
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 */
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":967
 *             free(deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":968
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(7, 968, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":962
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # free memomry that has been used to keeping value
 *         if deref(node).value != NULL:
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":957
 * 
 * 
 * cdef void __erase_node_float128_t(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_float128_t", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":971
 * 
 * 
 * cdef inline void __set_value_float128_t(node_ptr node, float128_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___set_value_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":973
 * cdef inline void __set_value_float128_t(node_ptr node, float128_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float128_t*>deref(node).value)[0] = value
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":974
 * 
 *     if deref(node).value != NULL:
 *         (<float128_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 *     else:
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":973
 * cdef inline void __set_value_float128_t(node_ptr node, float128_t value) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         (<float128_t*>deref(node).value)[0] = value
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":977
 * 
 *     else:
 *         deref(node).value = malloc( sizeof(float128_t) )             # <<<<<<<<<<<<<<
 *         (<float128_t*>deref(node).value)[0] = value
 * 
 */
  /*else*/ {
    (*__pyx_v_node).value = malloc((sizeof(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)));

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":978
 *     else:
 *         deref(node).value = malloc( sizeof(float128_t) )
 *         (<float128_t*>deref(node).value)[0] = value             # <<<<<<<<<<<<<<
 * 
 * 
 */
    (((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t *)(*__pyx_v_node).value)[0]) = __pyx_v_value;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":971
 * 
 * 
 * cdef inline void __set_value_float128_t(node_ptr node, float128_t value) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/dtype_tree_processing.pxi":981
 * 
 * 
 * cdef inline void __dealloc_value_float128_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_float128_t(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  int __pyx_t_1;

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":983
 * cdef inline void __dealloc_value_float128_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  __pyx_t_1 = (((*__pyx_v_node).value != NULL) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":984
 * 
 *     if deref(node).value != NULL:
 *         free(deref(node).value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    free((*__pyx_v_node).value);

    /* "redblackpy/cython_source/dtype_tree_processing.pxi":983
 * cdef inline void __dealloc_value_float128_t(node_ptr node) nogil except*:
 * 
 *     if deref(node).value != NULL:             # <<<<<<<<<<<<<<
 *         free(deref(node).value)
 * 
 */
  }

  /* "redblackpy/cython_source/dtype_tree_processing.pxi":981
 * 
 * 
 * cdef inline void __dealloc_value_float128_t(node_ptr node) nogil except*:             # <<<<<<<<<<<<<<
 * 
 *     if deref(node).value != NULL:
 */

  /* function exit code */
}

/* "redblackpy/cython_source/object_tree_processing.pxi":5
 * #  Copyright  2018 Intuition. All rights reserved.
 * #
 * cdef inline object __deref_value_ptr_object(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return <object>deref(node).value
 */

static CYTHON_INLINE PyObject *__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_void_ptr __pyx_t_1;
  __Pyx_RefNannySetupContext("__deref_value_ptr_object", 0);

  /* "redblackpy/cython_source/object_tree_processing.pxi":7
 * cdef inline object __deref_value_ptr_object(node_ptr node):
 * 
 *     return <object>deref(node).value             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = (*__pyx_v_node).value;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __pyx_r = ((PyObject *)__pyx_t_1);
  goto __pyx_L0;

  /* "redblackpy/cython_source/object_tree_processing.pxi":5
 * #  Copyright  2018 Intuition. All rights reserved.
 * #
 * cdef inline object __deref_value_ptr_object(node_ptr node):             # <<<<<<<<<<<<<<
 * 
 *     return <object>deref(node).value
 */

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

/* "redblackpy/cython_source/object_tree_processing.pxi":10
 * 
 * 
 * cdef inline void __insert_node_object(rb_tree_ptr& index, key, value) except*:             # <<<<<<<<<<<<<<
 * 
 *     index.insert( rb_node_valued( to_c_pyobject(key),
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_object(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_object", 0);

  /* "redblackpy/cython_source/object_tree_processing.pxi":12
 * cdef inline void __insert_node_object(rb_tree_ptr& index, key, value) except*:
 * 
 *     index.insert( rb_node_valued( to_c_pyobject(key),             # <<<<<<<<<<<<<<
 *                                   to_c_pyobject(value).data ) )
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_value).data);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(8, 12, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(8, 12, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/object_tree_processing.pxi":10
 * 
 * 
 * cdef inline void __insert_node_object(rb_tree_ptr& index, key, value) except*:             # <<<<<<<<<<<<<<
 * 
 *     index.insert( rb_node_valued( to_c_pyobject(key),
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/object_tree_processing.pxi":16
 * 
 * 
 * cdef inline void __insert_node_by_ptr_object( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                               key, value ) except*:
 * 
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_object(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, __pyx_t_10redblackpy_6series_11tree_series_node_ptr &__pyx_v_position, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued __pyx_t_1;
  __Pyx_RefNannySetupContext("__insert_node_by_ptr_object", 0);

  /* "redblackpy/cython_source/object_tree_processing.pxi":19
 *                                               key, value ) except*:
 * 
 *     index.insert( position, rb_node_valued( to_c_pyobject(key),             # <<<<<<<<<<<<<<
 *                                             to_c_pyobject(value).data ) )
 * 
 */
  try {
    __pyx_t_1 = __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued(__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key), __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_value).data);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(8, 19, __pyx_L1_error)
  }
  try {
    __pyx_v_index->insert(__pyx_v_position, __pyx_t_1);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(8, 19, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/object_tree_processing.pxi":16
 * 
 * 
 * cdef inline void __insert_node_by_ptr_object( rb_tree_ptr& index, node_ptr& position,             # <<<<<<<<<<<<<<
 *                                               key, value ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__insert_node_by_ptr_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/object_tree_processing.pxi":23
 * 
 * 
 * cdef void __erase_node_object(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___erase_node_object(__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr &__pyx_v_index, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__erase_node_object", 0);

  /* "redblackpy/cython_source/object_tree_processing.pxi":25
 * cdef void __erase_node_object(rb_tree_ptr& index, key) except*:
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *     cdef node_ptr node = index.search(c_key)
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/object_tree_processing.pxi":26
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *     cdef node_ptr node = index.search(c_key)             # <<<<<<<<<<<<<<
 * 
 *     if ( node != index.link() ):
 */
  try {
    __pyx_t_2 = __pyx_v_index->search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(8, 26, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_2;

  /* "redblackpy/cython_source/object_tree_processing.pxi":28
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy value
 *         Py_XDECREF(<PyObject*>deref(node).value)
 */
  __pyx_t_3 = ((__pyx_v_node != __pyx_v_index->link()) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/object_tree_processing.pxi":30
 *     if ( node != index.link() ):
 *         # Decrement reference counter to destroy value
 *         Py_XDECREF(<PyObject*>deref(node).value)             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 */
    Py_XDECREF(((PyObject *)(*__pyx_v_node).value));

    /* "redblackpy/cython_source/object_tree_processing.pxi":32
 *         Py_XDECREF(<PyObject*>deref(node).value)
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)             # <<<<<<<<<<<<<<
 *         index.erase(node)
 * 
 */
    Py_XDECREF((*__pyx_v_node).key.data);

    /* "redblackpy/cython_source/object_tree_processing.pxi":33
 *         # Decrement reference counter to destroy key
 *         Py_XDECREF(deref(node).key.data)
 *         index.erase(node)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    try {
      __pyx_v_index->erase(__pyx_v_node);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(8, 33, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/object_tree_processing.pxi":28
 *     cdef node_ptr node = index.search(c_key)
 * 
 *     if ( node != index.link() ):             # <<<<<<<<<<<<<<
 *         # Decrement reference counter to destroy value
 *         Py_XDECREF(<PyObject*>deref(node).value)
 */
  }

  /* "redblackpy/cython_source/object_tree_processing.pxi":23
 * 
 * 
 * cdef void __erase_node_object(rb_tree_ptr& index, key) except*:             # <<<<<<<<<<<<<<
 * 
 *     cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__erase_node_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/object_tree_processing.pxi":36
 * 
 * 
 * cdef void __set_value_object(node_ptr node, value) except*:             # <<<<<<<<<<<<<<
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)
 */

static void __pyx_f_10redblackpy_6series_11tree_series___set_value_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node, PyObject *__pyx_v_value) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1;
  __Pyx_RefNannySetupContext("__set_value_object", 0);

  /* "redblackpy/cython_source/object_tree_processing.pxi":38
 * cdef void __set_value_object(node_ptr node, value) except*:
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)             # <<<<<<<<<<<<<<
 *     deref(node).value = to_c_pyobject(value).data
 * 
 */
  Py_XDECREF(((PyObject *)(*__pyx_v_node).value));

  /* "redblackpy/cython_source/object_tree_processing.pxi":39
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)
 *     deref(node).value = to_c_pyobject(value).data             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_value).data;
  (*__pyx_v_node).value = __pyx_t_1;

  /* "redblackpy/cython_source/object_tree_processing.pxi":36
 * 
 * 
 * cdef void __set_value_object(node_ptr node, value) except*:             # <<<<<<<<<<<<<<
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)
 */

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

/* "redblackpy/cython_source/object_tree_processing.pxi":42
 * 
 * 
 * cdef inline void __dealloc_value_object(node_ptr node) except*:             # <<<<<<<<<<<<<<
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)
 */

static CYTHON_INLINE void __pyx_f_10redblackpy_6series_11tree_series___dealloc_value_object(__pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc_value_object", 0);

  /* "redblackpy/cython_source/object_tree_processing.pxi":44
 * cdef inline void __dealloc_value_object(node_ptr node) except*:
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)             # <<<<<<<<<<<<<<
 */
  Py_XDECREF(((PyObject *)(*__pyx_v_node).value));

  /* "redblackpy/cython_source/object_tree_processing.pxi":42
 * 
 * 
 * cdef inline void __dealloc_value_object(node_ptr node) except*:             # <<<<<<<<<<<<<<
 * 
 *     Py_XDECREF(<PyObject*>deref(node).value)
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":14
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":18
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint8_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 18, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_unsigned_char(values[4]); if (unlikely((__pyx_v_extrapolate == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 19, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 18, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 18, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 19, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 19, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":21
 *                    str interpolate="floor", uint8_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":22
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":23
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":24
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":26
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":27
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":29
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":31
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":32
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 32, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 32, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":31
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":29
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":35
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":36
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 36, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":35
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":39
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 39, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":18
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint8_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":46
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint8_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 46, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_unsigned_char(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 46, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 46, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 46, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 46, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 46, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":48
 *     cpdef void insert(self, key, uint8_t value) except*:
 * 
 *         __insert_node_uint8_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 48, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":46
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint8_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 46, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 46, __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_value = __Pyx_PyInt_As_unsigned_char(values[1]); if (unlikely((__pyx_v_value == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 46, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 46, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 46, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 46, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":51
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 51, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 51, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 51, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 51, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 51, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":55
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint8_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 55, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 55, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 55, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 55, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":56
 * 
 *         for pair in pairs:
 *             __insert_node_uint8_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 56, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 56, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_char(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 56, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 56, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":55
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint8_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":51
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 51, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 51, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 51, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":59
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint8_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 59, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 59, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 59, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":61
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_uint8_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 61, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":59
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint8_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 59, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 59, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":64
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 64, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 64, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 64, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 64, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 64, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 64, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":68
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_uint8_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 68, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 68, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":69
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_uint8_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 69, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 69, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":64
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 64, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 64, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 64, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":72
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 72, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 72, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 72, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 72, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":75
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":77
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint8_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":78
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_uint8_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 78, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 78, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":77
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint8_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":80
 *             result.append( __deref_value_ptr_uint8_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":72
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 72, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":83
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 83, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 83, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 83, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 83, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":86
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 86, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":88
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint8_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":89
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint8_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":90
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint8_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 90, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":89
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint8_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 89, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 89, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":88
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint8_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":92
 *                              __deref_value_ptr_uint8_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":83
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 83, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_18generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":95
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 95, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_18generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_uint8_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 95, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_18generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 95, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":99
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint8_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":100
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint8_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 100, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":99
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint8_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":95
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":103
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 103, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 103, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 103, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 103, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 103, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 103, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":107
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":108
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 108, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":110
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":111
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__6);
    __pyx_r = __pyx_tuple__6;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":110
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":113
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint8_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":114
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_uint8_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":113
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint8_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":103
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.floor", __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_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 103, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":117
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 117, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 117, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 117, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 117, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 117, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 117, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":121
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":122
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 122, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":124
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":125
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__7);
    __pyx_r = __pyx_tuple__7;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":124
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":127
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint8_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":128
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_uint8_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":127
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint8_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":117
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.ceil", __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_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 117, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":131
 * 
 * 
 *     cpdef __TreeSeries_uint8_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 131, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 131, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 131, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 131, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":139
 *         cdef __TreeSeries_uint8_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":140
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":143
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 143, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":144
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 143, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":142
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 142, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":146
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 146, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":147
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 147, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":148
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":149
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":151
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":152
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":151
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":154
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":151
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":156
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 156, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":157
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":156
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":159
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint8_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":160
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_uint8_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":161
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint8_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":163
 *                            __deref_value_ptr_uint8_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":164
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":163
 *                            __deref_value_ptr_uint8_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":166
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":168
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":131
 * 
 * 
 *     cpdef __TreeSeries_uint8_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 131, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 131, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 131, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 131, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":171
 * 
 * 
 *     cpdef __TreeSeries_uint8_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 171, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 171, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 171, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 171, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":174
 * 
 *         cdef __TreeSeries_uint8_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":176
 *         cdef object it = start
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 176, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":177
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 176, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":175
 *         cdef __TreeSeries_uint8_t result
 *         cdef object it = start
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 175, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":179
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":181
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 181, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":182
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 182, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 182, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_char(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 182, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 182, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":183
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":185
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":187
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":171
 * 
 * 
 *     cpdef __TreeSeries_uint8_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 171, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 171, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 171, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 171, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 171, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":190
 * 
 * 
 *     cpdef __TreeSeries_uint8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__8;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 190, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 190, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 190, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 190, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":197
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 197, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":198
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 197, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":196
 *         cdef tuple it
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 196, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":200
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 200, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 200, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 200, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":201
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 201, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 201, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 201, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 201, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_char(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 201, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 201, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":203
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":190
 * 
 * 
 *     cpdef __TreeSeries_uint8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __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  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 190, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 190, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 190, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 191, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 190, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":206
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__9;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 206, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 206, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 206, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":211
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":212
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":213
 *         for it in deref(self.__index):
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 213, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":212
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":213
 *         for it in deref(self.__index):
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 213, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":212
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_char(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_uint8_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 212, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":211
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint8_t( it, method( __deref_value_ptr_uint8_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":206
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__9;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 206, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 206, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 206, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 207, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 206, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":216
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 216, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 216, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 216, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 216, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":218
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint8_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 218, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":219
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_uint8_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":220
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint8_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":216
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint8_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 216, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 216, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":223
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 223, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 223, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":225
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 225, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":226
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":225
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":228
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 228, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":229
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":228
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":223
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint8_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 223, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 223, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":232
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 232, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 232, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":234
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":235
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":232
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint8_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 232, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":238
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 238, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 238, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":240
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":241
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":238
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint8_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 238, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":244
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":248
 *         cdef tuple it
 *         cdef uint8_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 248, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":250
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 250, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":252
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <uint8_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 252, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 252, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":253
 * 
 *             for it in other.iteritems():
 *                 num = <uint8_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 253, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 253, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":254
 *             for it in other.iteritems():
 *                 num = <uint8_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 254, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 254, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":250
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":256
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 256, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":257
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 257, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 257, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 257, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":258
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 258, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 258, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 258, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_char(__pyx_t_3); if (unlikely((__pyx_t_13 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 258, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 258, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":256
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":261
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 261, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 261, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 261, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":262
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 262, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 262, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_char(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 262, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 262, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":244
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 244, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 244, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 244, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 244, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":265
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 265, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 265, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":267
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 267, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 267, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":268
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 268, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":267
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":270
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":265
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 265, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 265, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":275
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":277
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":275
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":280
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":282
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":283
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":285
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":287
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 287, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 287, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":288
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 288, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 288, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 288, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":289
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 289, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 289, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 289, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 289, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 289, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 289, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":288
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":287
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":292
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 292, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 292, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 292, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 292, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 292, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":293
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 293, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 293, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 293, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 293, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 293, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 293, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":292
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":295
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":297
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 297, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 297, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 297, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":298
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 298, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 298, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 298, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 298, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 298, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 298, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":297
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":300
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":280
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_uint8_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":303
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":305
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 305, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 305, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":303
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_51generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":308
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 308, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_51generator1, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_uint8_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 308, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_51generator1(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 308, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":312
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint8_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":313
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_uint8_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 313, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":312
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint8_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":308
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":316
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":318
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef uint8_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":321
 *         cdef uint8_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":322
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":321
 *         cdef uint8_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":324
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":325
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":324
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":327
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":329
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":330
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_char(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 330, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":329
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":332
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":333
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 333, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":332
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":335
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":336
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 336, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":335
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":316
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":339
 * 
 * 
 *     def __setitem__(self, key, uint8_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_unsigned_char(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 339, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":341
 *     def __setitem__(self, key, uint8_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":342
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 342, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":344
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint8_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":345
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_uint8_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 345, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":344
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint8_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":348
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint8_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 348, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":349
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_uint8_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_uint8_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 349, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":348
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint8_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":352
 * 
 *             else:
 *                 __insert_node_by_ptr_uint8_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 352, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":339
 * 
 * 
 *     def __setitem__(self, key, uint8_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":358
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint8_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 358, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 358, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 358, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 358, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 358, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 358, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":360
 *     cpdef __TreeSeries_uint8_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_uint8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_uint8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":358
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint8_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 358, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 358, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":363
 * 
 * 
 *     cpdef __TreeSeries_uint8_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 363, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 363, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 363, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 363, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 363, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":365
 *     cpdef __TreeSeries_uint8_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_uint8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_uint8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":363
 * 
 * 
 *     cpdef __TreeSeries_uint8_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 363, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 363, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":368
 * 
 * 
 *     cpdef __TreeSeries_uint8_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 368, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 368, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 368, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":370
 *     cpdef __TreeSeries_uint8_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_uint8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_uint8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":368
 * 
 * 
 *     cpdef __TreeSeries_uint8_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 368, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 368, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":373
 * 
 * 
 *     cpdef __TreeSeries_uint8_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 373, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 373, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 373, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 373, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 373, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 373, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":375
 *     cpdef __TreeSeries_uint8_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_uint8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_uint8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":373
 * 
 * 
 *     cpdef __TreeSeries_uint8_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 373, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 373, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":378
 * 
 * 
 *     cpdef __TreeSeries_uint8_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 378, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":380
 *     cpdef __TreeSeries_uint8_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":381
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 381, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":380
 *     cpdef __TreeSeries_uint8_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":378
 * 
 * 
 *     cpdef __TreeSeries_uint8_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 378, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":384
 * 
 * 
 *     cpdef __TreeSeries_uint8_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 384, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 384, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 384, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 384, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 384, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 384, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t))))) __PYX_ERR(3, 384, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":386
 *     cpdef __TreeSeries_uint8_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":387
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 387, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":386
 *     cpdef __TreeSeries_uint8_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":384
 * 
 * 
 *     cpdef __TreeSeries_uint8_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 384, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":393
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":397
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 397, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 397, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":398
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 398, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":397
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":400
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 400, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 400, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 400, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 400, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 400, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 400, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":401
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 401, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 401, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_char(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 401, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 401, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":400
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":393
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":404
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":406
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 406, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 406, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 406, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 406, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 406, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":407
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 407, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":406
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":404
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":410
 * 
 * 
 *     cdef uint8_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":413
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":416
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 416, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":417
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":419
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":420
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":419
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":423
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":425
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":410
 * 
 * 
 *     cdef uint8_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint8_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":430
 * 
 * 
 *     cdef uint8_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":432
 *     cdef uint8_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":435
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 435, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":436
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":438
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":430
 * 
 * 
 *     cdef uint8_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint8_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":443
 * 
 * 
 *     cdef __TreeSeries_uint8_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":446
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint8_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":447
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":450
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 450, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":451
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 450, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":449
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 449, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":453
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 453, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 453, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":454
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":453
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":456
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":458
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 458, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":459
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":458
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":461
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 461, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":462
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":461
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":456
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":464
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":465
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":466
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 466, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":464
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":468
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":469
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":470
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 470, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":468
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":472
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":473
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":472
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":475
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":472
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":477
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":478
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":477
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":480
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":481
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":482
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":481
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 481, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":480
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":485
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":486
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":487
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 487, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":485
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 485, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":443
 * 
 * 
 *     cdef __TreeSeries_uint8_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":490
 * 
 * 
 *     cdef __TreeSeries_uint8_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":493
 * 
 *         cdef __TreeSeries_uint8_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":495
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":496
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":499
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 499, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":500
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 499, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":498
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 498, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":501
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":502
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 502, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":501
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":504
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 504, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 504, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 504, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":506
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":507
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 507, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_char(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 507, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 507, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":508
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":506
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":510
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":511
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":510
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":513
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 513, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 513, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":514
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":516
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":490
 * 
 * 
 *     cdef __TreeSeries_uint8_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":519
 * 
 * 
 *     cdef __TreeSeries_uint8_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":522
 * 
 *         cdef __TreeSeries_uint8_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":524
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":525
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":528
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 528, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":529
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 528, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":527
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 527, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":530
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 530, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":532
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":533
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 533, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":532
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":535
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 535, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 535, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 535, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":537
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":538
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 538, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_unsigned_char(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 538, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 538, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":539
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 539, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":537
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":541
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":542
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":541
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":544
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 544, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 544, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":545
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":547
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":530
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":519
 * 
 * 
 *     cdef __TreeSeries_uint8_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":550
 * 
 * 
 *     cdef __TreeSeries_uint8_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint8_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":558
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 558, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":559
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 558, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":557
 *         cdef object key
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 557, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":560
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":562
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":564
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_uint8_t(node), other[key])
 *             __insert_node_uint8_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":565
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint8_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint8_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_char(__pyx_t_2); if (unlikely((__pyx_t_6 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 565, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint8_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":566
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint8_t(node), other[key])
 *             __insert_node_uint8_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint8_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 566, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":562
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":568
 *             __insert_node_uint8_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":570
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":550
 * 
 * 
 *     cdef __TreeSeries_uint8_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint8_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":573
 * 
 * 
 *     cdef __TreeSeries_uint8_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint8_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":579
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 579, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":582
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 582, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":583
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 582, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":581
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_uint8_t result
 *         result = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 581, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":585
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":586
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":587
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":588
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":589
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 589, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 589, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":591
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":592
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":594
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":595
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint8_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":596
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint8_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 596, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 596, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_char(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 596, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_char(__pyx_t_3); if (unlikely((__pyx_t_11 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 596, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":597
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint8_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint8_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 597, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":598
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint8_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":600
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":601
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":603
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_uint16_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":573
 * 
 * 
 *     cdef __TreeSeries_uint8_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint8_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8
 *     cdef arithmetic_type_uint8_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 8, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":9
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   uint8_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 9, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":10
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   uint8_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":11
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   uint8_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_char(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 11, __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("redblackpy.series.tree_series.__TreeSeries_uint8_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_char(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned char)-1) && PyErr_Occurred())) __PYX_ERR(3, 11, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint8_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":617
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":621
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint16_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 621, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_unsigned_short(values[4]); if (unlikely((__pyx_v_extrapolate == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 622, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 621, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 621, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 622, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 622, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":624
 *                    str interpolate="floor", uint16_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":625
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":626
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":627
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":629
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":630
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":632
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":634
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":635
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 635, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":634
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":632
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":638
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":639
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 639, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":638
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":642
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 642, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":621
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint16_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":649
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint16_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_unsigned_short(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 649, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":651
 *     cpdef void insert(self, key, uint16_t value) except*:
 * 
 *         __insert_node_uint16_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 651, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":649
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint16_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 649, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 649, __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_value = __Pyx_PyInt_As_unsigned_short(values[1]); if (unlikely((__pyx_v_value == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 649, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 649, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 649, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 649, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":654
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 654, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 654, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":658
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint16_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 658, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 658, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 658, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":659
 * 
 *         for pair in pairs:
 *             __insert_node_uint16_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 659, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 659, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_short(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 659, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":658
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint16_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":654
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 654, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 654, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 654, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":662
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint16_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 662, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 662, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 662, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 662, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 662, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":664
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_uint16_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 664, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":662
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint16_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 662, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 662, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":667
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 667, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 667, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 667, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":671
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_uint16_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 671, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 671, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":672
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_uint16_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 672, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 672, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":667
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 667, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 667, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 667, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":675
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 675, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 675, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 675, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":678
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 678, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":680
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint16_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":681
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_uint16_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 681, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 681, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":680
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint16_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":683
 *             result.append( __deref_value_ptr_uint16_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":675
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 675, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":686
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 686, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 686, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 686, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":689
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":691
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint16_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":692
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint16_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":693
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint16_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":692
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint16_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 692, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":691
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint16_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":695
 *                              __deref_value_ptr_uint16_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":686
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 686, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":698
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 698, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_18generator2, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_uint16_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 698, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_18generator2(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 698, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":702
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint16_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":703
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint16_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 703, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":702
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint16_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":698
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":706
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 706, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 706, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 706, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 706, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 706, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 706, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":710
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":711
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 711, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":713
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":714
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__18);
    __pyx_r = __pyx_tuple__18;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":713
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":716
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint16_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":717
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_uint16_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":716
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint16_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":706
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.floor", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 706, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":720
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 720, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 720, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 720, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 720, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 720, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 720, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":724
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":725
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 725, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":727
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":728
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__19);
    __pyx_r = __pyx_tuple__19;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":727
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":730
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint16_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":731
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_uint16_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":730
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint16_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 730, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":720
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.ceil", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 720, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":734
 * 
 * 
 *     cpdef __TreeSeries_uint16_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 734, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 734, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 734, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 734, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 734, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":742
 *         cdef __TreeSeries_uint16_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":743
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":746
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 746, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":747
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 746, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":745
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 745, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":749
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 749, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":750
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 750, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":751
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":752
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":754
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":755
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":754
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":757
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":754
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":759
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 759, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":760
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":759
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":762
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint16_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":763
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_uint16_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":764
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint16_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 763, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":766
 *                            __deref_value_ptr_uint16_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":767
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":766
 *                            __deref_value_ptr_uint16_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":769
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":771
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":734
 * 
 * 
 *     cpdef __TreeSeries_uint16_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 734, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 734, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 734, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 734, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":774
 * 
 * 
 *     cpdef __TreeSeries_uint16_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 774, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 774, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 774, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 774, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 774, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":777
 * 
 *         cdef __TreeSeries_uint16_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":779
 *         cdef object it = start
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 779, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":780
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 779, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":778
 *         cdef __TreeSeries_uint16_t result
 *         cdef object it = start
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 778, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":782
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":784
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 784, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 784, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":785
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 785, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 785, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 785, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 785, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":786
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":788
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":790
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":774
 * 
 * 
 *     cpdef __TreeSeries_uint16_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 774, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 774, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 774, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 774, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":793
 * 
 * 
 *     cpdef __TreeSeries_uint16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__20;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 793, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 793, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 793, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 793, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 793, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":800
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 800, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":801
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 800, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":799
 *         cdef tuple it
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 799, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":803
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 803, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 803, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 803, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":804
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 804, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 804, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 804, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 804, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 804, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 804, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":806
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":793
 * 
 * 
 *     cpdef __TreeSeries_uint16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__20;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 793, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 793, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 793, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 794, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 793, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":809
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__21;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 809, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 809, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 809, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 809, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 809, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":814
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":815
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":816
 *         for it in deref(self.__index):
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 816, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":815
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":816
 *         for it in deref(self.__index):
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 816, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":815
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 815, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_uint16_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 815, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":814
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint16_t( it, method( __deref_value_ptr_uint16_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":809
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__21;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 809, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 809, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 809, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 810, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":819
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 819, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 819, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 819, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 819, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":821
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint16_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 821, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":822
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_uint16_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":823
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint16_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":819
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint16_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 819, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 819, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":826
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 826, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 826, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":828
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 828, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":829
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":828
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":831
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 831, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":832
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":831
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":826
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint16_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 826, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 826, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":835
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 835, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 835, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":837
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":838
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":835
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint16_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 835, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":841
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 841, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 841, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":843
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":844
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":841
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint16_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 841, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":847
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 847, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 847, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":851
 *         cdef tuple it
 *         cdef uint16_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 851, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":853
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 853, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":855
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <uint16_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 855, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 855, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":856
 * 
 *             for it in other.iteritems():
 *                 num = <uint16_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 856, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 856, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":857
 *             for it in other.iteritems():
 *                 num = <uint16_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 857, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 857, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":853
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":859
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 859, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":860
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 860, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 860, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":861
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 861, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 861, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_13 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 861, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 861, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":859
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":864
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 864, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 864, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 864, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":865
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 865, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 865, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_short(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 865, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 865, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":847
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 847, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 847, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 847, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 847, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 847, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":868
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 868, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 868, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":870
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 870, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 870, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 870, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":871
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 871, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":870
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":873
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":868
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 868, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 868, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":878
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":880
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":878
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":883
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":885
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":886
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":888
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":890
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 890, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 890, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":891
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 891, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 891, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 891, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":892
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 892, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 892, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 892, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 892, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 892, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":891
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":890
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":895
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 895, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 895, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 895, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 895, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 895, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":896
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 896, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 896, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 896, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 896, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 896, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":895
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":898
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":900
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 900, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 900, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 900, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 900, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":901
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 901, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 901, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 901, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 901, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 901, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":900
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":903
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":883
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_uint16_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":906
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":908
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 908, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 908, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":906
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_51generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":911
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 911, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_51generator3, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_uint16_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 911, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_51generator3(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 911, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":915
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint16_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":916
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_uint16_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 916, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":915
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint16_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":911
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":919
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":921
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef uint16_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":924
 *         cdef uint16_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":925
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":924
 *         cdef uint16_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":927
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":928
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":927
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":930
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":932
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":933
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_short(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":932
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":935
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":936
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 936, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 936, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":935
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":938
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":939
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 939, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":938
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":919
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":942
 * 
 * 
 *     def __setitem__(self, key, uint16_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_unsigned_short(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 942, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":944
 *     def __setitem__(self, key, uint16_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":945
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 945, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":947
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint16_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":948
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_uint16_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 948, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":947
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint16_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":951
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint16_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 951, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 951, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":952
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_uint16_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_uint16_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 952, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":951
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint16_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":955
 * 
 *             else:
 *                 __insert_node_by_ptr_uint16_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 955, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":942
 * 
 * 
 *     def __setitem__(self, key, uint16_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":961
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint16_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 961, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 961, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 961, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 961, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 961, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 961, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":963
 *     cpdef __TreeSeries_uint16_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_uint16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_uint16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":961
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint16_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 961, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 961, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":966
 * 
 * 
 *     cpdef __TreeSeries_uint16_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 966, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 966, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 966, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 966, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 966, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":968
 *     cpdef __TreeSeries_uint16_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_uint16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_uint16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":966
 * 
 * 
 *     cpdef __TreeSeries_uint16_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 966, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 966, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":971
 * 
 * 
 *     cpdef __TreeSeries_uint16_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 971, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 971, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 971, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 971, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 971, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 971, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 971, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":973
 *     cpdef __TreeSeries_uint16_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_uint16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_uint16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":971
 * 
 * 
 *     cpdef __TreeSeries_uint16_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 971, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 971, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":976
 * 
 * 
 *     cpdef __TreeSeries_uint16_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 976, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 976, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 976, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 976, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 976, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 976, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":978
 *     cpdef __TreeSeries_uint16_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_uint16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_uint16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":976
 * 
 * 
 *     cpdef __TreeSeries_uint16_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 976, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 976, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":981
 * 
 * 
 *     cpdef __TreeSeries_uint16_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 981, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 981, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 981, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 981, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 981, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":983
 *     cpdef __TreeSeries_uint16_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":984
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 984, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":983
 *     cpdef __TreeSeries_uint16_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":981
 * 
 * 
 *     cpdef __TreeSeries_uint16_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 981, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":987
 * 
 * 
 *     cpdef __TreeSeries_uint16_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 987, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 987, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 987, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 987, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 987, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 987, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t))))) __PYX_ERR(3, 987, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":989
 *     cpdef __TreeSeries_uint16_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":990
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 990, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 990, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":989
 *     cpdef __TreeSeries_uint16_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":987
 * 
 * 
 *     cpdef __TreeSeries_uint16_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 987, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":996
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1000
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1000, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1000, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1001
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 1001, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1000
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1003
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1003, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1003, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 1003, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1003, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 1003, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1003, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1003, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 1003, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1004
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1004, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1004, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_short(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 1004, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1004, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1003
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":996
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1007
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1009
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1009, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 1009, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1009, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 1009, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1009, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1009, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1010
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1010, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1009
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1007
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1013
 * 
 * 
 *     cdef uint16_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1016
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1019
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1019, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1020
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1022
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1023
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1022
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1026
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1028
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1013
 * 
 * 
 *     cdef uint16_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint16_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1033
 * 
 * 
 *     cdef uint16_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1035
 *     cdef uint16_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1038
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1038, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1039
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1041
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1033
 * 
 * 
 *     cdef uint16_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint16_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1046
 * 
 * 
 *     cdef __TreeSeries_uint16_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1049
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint16_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1050
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1053
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1053, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1054
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1053, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1052
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1052, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1056
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1056, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1056, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1056, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 1056, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1057
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1056
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1059
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1059, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1061
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1061, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1062
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1061
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1064
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1064, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1065
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1064
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1059
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1067
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1067, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1068
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1069
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 1069, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1067
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1071
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1072
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1073
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 1073, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1071
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1075
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1076
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1075
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1078
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1075
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1080
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1081
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1080
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1083
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1084
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1085
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1084
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1084, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1083
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1088
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1088, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1089
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1090
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1090, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1088
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 1088, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1046
 * 
 * 
 *     cdef __TreeSeries_uint16_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1093
 * 
 * 
 *     cdef __TreeSeries_uint16_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1096
 * 
 *         cdef __TreeSeries_uint16_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1096, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1098
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1099
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1102
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1102, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1102, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1103
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1102, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1101
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1101, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1104
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1105
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 1105, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1104
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1107
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 1107, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 1107, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1107, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1109
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1110
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1110, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_short(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 1110, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1110, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1111
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1111, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1109
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1113
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1114
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1113
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1116
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1116, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 1116, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1117
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1119
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1093
 * 
 * 
 *     cdef __TreeSeries_uint16_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1122
 * 
 * 
 *     cdef __TreeSeries_uint16_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1125
 * 
 *         cdef __TreeSeries_uint16_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1127
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1128
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1131
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1131, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1132
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1131, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1130
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1130, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1133
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1133, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1135
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1136
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 1136, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1135
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1138
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 1138, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1138, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 1138, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1138, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1140
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1141
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 1141, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_unsigned_short(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 1141, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1141, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1142
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1142, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1140
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1144
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1145
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1144
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1147
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1147, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 1147, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1148
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1150
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1133
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1122
 * 
 * 
 *     cdef __TreeSeries_uint16_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1153
 * 
 * 
 *     cdef __TreeSeries_uint16_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint16_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1161
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1161, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1162
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1161, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1160
 *         cdef object key
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1160, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1163
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1165
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1167
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_uint16_t(node), other[key])
 *             __insert_node_uint16_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1168
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint16_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint16_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_short(__pyx_t_2); if (unlikely((__pyx_t_6 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 1168, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint16_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1169
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint16_t(node), other[key])
 *             __insert_node_uint16_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint16_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1169, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1165
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1171
 *             __insert_node_uint16_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1173
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1153
 * 
 * 
 *     cdef __TreeSeries_uint16_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint16_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1176
 * 
 * 
 *     cdef __TreeSeries_uint16_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint16_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1182
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 1182, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1185
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1185, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1186
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1185, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1184
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_uint16_t result
 *         result = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1184, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1188
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1189
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1190
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1191
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1192
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1192, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 1192, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1194
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1195
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1197
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1198
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint16_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1199
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint16_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1199, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1199, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1199, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 1199, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1199, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 1199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1199, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_short(__pyx_t_3); if (unlikely((__pyx_t_11 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 1199, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1200
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint16_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint16_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1200, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1201
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint16_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1203
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1204
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1206
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_uint32_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1176
 * 
 * 
 *     cdef __TreeSeries_uint16_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint16_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":611
 *     cdef arithmetic_type_uint16_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 611, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":612
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   uint16_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 612, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":613
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   uint16_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":614
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   uint16_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_short(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 614, __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("redblackpy.series.tree_series.__TreeSeries_uint16_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_short(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned short)-1) && PyErr_Occurred())) __PYX_ERR(3, 614, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint16_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1220
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1224
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint32_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 1224, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_unsigned_int(values[4]); if (unlikely((__pyx_v_extrapolate == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1225, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1224, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 1224, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 1225, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 1225, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1227
 *                    str interpolate="floor", uint32_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1228
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1229
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1230
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1232
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1233
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1235
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1237
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1238
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1238, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 1238, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1237
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1235
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1241
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1242
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1242, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1241
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1245
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1245, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1224
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint32_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1252
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint32_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1252, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1252, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1252, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1252, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1254
 *     cpdef void insert(self, key, uint32_t value) except*:
 * 
 *         __insert_node_uint32_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1254, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1252
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint32_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 1252, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 1252, __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_value = __Pyx_PyInt_As_unsigned_int(values[1]); if (unlikely((__pyx_v_value == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1252, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1252, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1252, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1252, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1257
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1257, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1257, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1257, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1257, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1257, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1261
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint32_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 1261, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 1261, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1261, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1262
 * 
 *         for pair in pairs:
 *             __insert_node_uint32_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1262, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1262, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1262, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1261
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint32_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1257
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 1257, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1257, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1257, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1265
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint32_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1265, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1265, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1265, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1265, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1265, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1267
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_uint32_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1267, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1265
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint32_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1265, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1265, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1270
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1270, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1270, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1270, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1270, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1270, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1274
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_uint32_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 1274, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1274, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1275
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_uint32_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1275, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1275, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1270
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 1270, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1270, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1270, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1278
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1278, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1278, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1278, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1281
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1281, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1283
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint32_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1284
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_uint32_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1284, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 1284, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1283
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint32_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1286
 *             result.append( __deref_value_ptr_uint32_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1278
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1278, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1289
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1289, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1289, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1289, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1292
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1294
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint32_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1295
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint32_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1296
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint32_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1295
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint32_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 1295, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1294
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint32_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1298
 *                              __deref_value_ptr_uint32_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1289
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1289, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_18generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":1301
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 1301, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_18generator4, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_uint32_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 1301, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_18generator4(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 1301, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1305
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint32_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1306
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint32_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 1306, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1305
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint32_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1301
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1309
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1309, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1309, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1309, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1309, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1309, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1309, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1313
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1314
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1314, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1316
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1317
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__28);
    __pyx_r = __pyx_tuple__28;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1316
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1319
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint32_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1320
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_uint32_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1319
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint32_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1309
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.floor", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1309, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1323
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1323, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1323, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1323, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1323, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1323, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1323, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1327
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1328
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1328, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1330
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1331
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__29);
    __pyx_r = __pyx_tuple__29;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1330
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1333
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint32_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1334
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_uint32_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1333
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint32_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1323
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.ceil", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1323, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1337
 * 
 * 
 *     cpdef __TreeSeries_uint32_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1337, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1337, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1337, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1337, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1345
 *         cdef __TreeSeries_uint32_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1346
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1349
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1350
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1349, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1348
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1348, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1352
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1352, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1353
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1353, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1354
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1355
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1357
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1358
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1357
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1360
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1357
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1362
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 1362, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1363
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1362
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1365
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint32_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1366
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_uint32_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1367
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint32_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1366, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1369
 *                            __deref_value_ptr_uint32_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1370
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1369
 *                            __deref_value_ptr_uint32_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1372
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1374
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1337
 * 
 * 
 *     cpdef __TreeSeries_uint32_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 1337, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 1337, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1337, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1337, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1377
 * 
 * 
 *     cpdef __TreeSeries_uint32_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1377, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1377, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1377, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1380
 * 
 *         cdef __TreeSeries_uint32_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1382
 *         cdef object it = start
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1382, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1383
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1382, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1381
 *         cdef __TreeSeries_uint32_t result
 *         cdef object it = start
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1381, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1385
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1387
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1387, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 1387, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1388
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1388, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1388, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1388, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1388, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1388, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1389
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1391
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1393
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1377
 * 
 * 
 *     cpdef __TreeSeries_uint32_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 1377, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 1377, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 1377, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1377, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1377, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1396
 * 
 * 
 *     cpdef __TreeSeries_uint32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__30;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1396, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1396, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1396, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1396, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1396, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1403
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1403, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1404
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1403, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1402
 *         cdef tuple it
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1402, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1406
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 1406, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 1406, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1406, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1407
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1407, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1407, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 1407, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 1407, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1407, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1409
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1396
 * 
 * 
 *     cpdef __TreeSeries_uint32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__30;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 1396, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1396, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 1396, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 1397, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1396, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1412
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__31;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1412, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1412, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1412, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1417
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1418
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1419
 *         for it in deref(self.__index):
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 1419, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1418
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1419
 *         for it in deref(self.__index):
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 1419, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1418
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1418, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_uint32_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1418, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1417
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint32_t( it, method( __deref_value_ptr_uint32_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1412
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__31;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 1412, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1412, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 1412, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 1413, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1412, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1422
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1422, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1422, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1422, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1422, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1424
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint32_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1425
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_uint32_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1426
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint32_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1422
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint32_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 1422, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1422, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1429
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1429, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1429, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1429, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1429, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1431
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 1431, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1432
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1431
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1434
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 1434, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1435
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1434
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1429
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint32_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 1429, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1429, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1438
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1438, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1438, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1440
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1441
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1438
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint32_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1438, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1444
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1444, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1444, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1446
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1447
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1444
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint32_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1444, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1450
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1450, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1450, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1450, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1450, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1450, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1454
 *         cdef tuple it
 *         cdef uint32_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1454, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1456
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 1456, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1458
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <uint32_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 1458, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 1458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1458, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1459
 * 
 *             for it in other.iteritems():
 *                 num = <uint32_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1459, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 1459, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1460
 *             for it in other.iteritems():
 *                 num = <uint32_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1460, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1460, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1456
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1462
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 1462, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1463
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 1463, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 1463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1463, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1464
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1464, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1464, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1464, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1464, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1464, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1462
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1467
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 1467, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 1467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1467, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1468
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1468, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1468, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_int(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1468, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1468, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1450
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 1450, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1450, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 1450, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1450, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1471
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1471, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1471, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1473
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1473, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 1473, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 1473, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1474
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1474, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1473
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1476
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1471
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1471, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1471, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1481
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1483
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1481
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1486
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1488
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1489
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1489, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1491
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1491, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1493
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 1493, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1493, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1494
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 1494, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 1494, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1494, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1495
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1495, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 1495, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1495, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 1495, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1495, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 1495, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1494
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1493
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1498
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1498, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1498, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 1498, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1498, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1499
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1499, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 1499, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1499, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 1499, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 1499, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1498
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1501
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1503
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1503, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 1503, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 1503, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1504
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1504, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 1504, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1504, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 1504, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1504, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1503
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1506
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1486
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_uint32_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1509
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1511
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1511, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1509
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_51generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":1514
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 1514, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_51generator5, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_uint32_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 1514, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_51generator5(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 1514, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1518
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint32_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1519
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_uint32_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 1519, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1518
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint32_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1514
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1522
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1524
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef uint32_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1527
 *         cdef uint32_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1528
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1527
 *         cdef uint32_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1530
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1531
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1530
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1533
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1535
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1536
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1536, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1535
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1538
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1539
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 1539, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1538
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1541
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1542
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 1542, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1541
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1522
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1545
 * 
 * 
 *     def __setitem__(self, key, uint32_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_unsigned_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1545, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1547
 *     def __setitem__(self, key, uint32_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1548
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1548, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1550
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint32_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1551
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_uint32_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1551, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1550
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint32_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1554
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint32_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 1554, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1555
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_uint32_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_uint32_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1555, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1554
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint32_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1558
 * 
 *             else:
 *                 __insert_node_by_ptr_uint32_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1558, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1545
 * 
 * 
 *     def __setitem__(self, key, uint32_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1564
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint32_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1564, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1564, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1564, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1564, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1564, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1564, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1566
 *     cpdef __TreeSeries_uint32_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_uint32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_uint32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1564
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint32_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 1564, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1564, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1569
 * 
 * 
 *     cpdef __TreeSeries_uint32_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1569, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1569, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1569, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1569, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1569, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1571
 *     cpdef __TreeSeries_uint32_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_uint32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_uint32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1569
 * 
 * 
 *     cpdef __TreeSeries_uint32_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 1569, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1569, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1574
 * 
 * 
 *     cpdef __TreeSeries_uint32_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1574, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1574, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1574, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1574, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1574, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1574, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1576
 *     cpdef __TreeSeries_uint32_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_uint32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_uint32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1574
 * 
 * 
 *     cpdef __TreeSeries_uint32_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 1574, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1574, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1579
 * 
 * 
 *     cpdef __TreeSeries_uint32_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1579, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1579, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1579, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1579, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1581
 *     cpdef __TreeSeries_uint32_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_uint32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_uint32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1579
 * 
 * 
 *     cpdef __TreeSeries_uint32_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 1579, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1579, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1584
 * 
 * 
 *     cpdef __TreeSeries_uint32_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1584, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1584, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1584, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1584, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1584, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1586
 *     cpdef __TreeSeries_uint32_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1587
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1587, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1586
 *     cpdef __TreeSeries_uint32_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1584
 * 
 * 
 *     cpdef __TreeSeries_uint32_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1584, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1590
 * 
 * 
 *     cpdef __TreeSeries_uint32_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1590, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1590, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1590, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1590, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t))))) __PYX_ERR(3, 1590, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1592
 *     cpdef __TreeSeries_uint32_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1593
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 1593, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1593, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1592
 *     cpdef __TreeSeries_uint32_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1590
 * 
 * 
 *     cpdef __TreeSeries_uint32_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1590, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1599
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1603
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1603, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1603, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1604
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 1604, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1603
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1606
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1606, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 1606, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 1606, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1606, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1606, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 1606, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1607
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1607, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1607, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1607, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1607, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1606
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1599
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1610
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1612
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1612, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 1612, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 1612, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1612, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 1612, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1613
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1613, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1612
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1610
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1616
 * 
 * 
 *     cdef uint32_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1619
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1622
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1622, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1623
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1625
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1626
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1625
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1629
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1631
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1616
 * 
 * 
 *     cdef uint32_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint32_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1636
 * 
 * 
 *     cdef uint32_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1638
 *     cdef uint32_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1641
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1641, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1642
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1644
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1636
 * 
 * 
 *     cdef uint32_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint32_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1649
 * 
 * 
 *     cdef __TreeSeries_uint32_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1652
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint32_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1653
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1656
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1656, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1657
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1656, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1655
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1655, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1659
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1659, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1659, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1659, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 1659, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1660
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1659
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1662
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1662, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1664
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1664, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1665
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1664
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1667
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 1667, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1668
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1667
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1662
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1670
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1670, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1671
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1672
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 1672, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1670
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1674
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1675
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1675, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1676
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 1676, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1674
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1678
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1679
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1678
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1681
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1678
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1683
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1684
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1683
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1686
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1687
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1688
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1687
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1687, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1686
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1691
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1692
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1693
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1693, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1691
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 1691, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1649
 * 
 * 
 *     cdef __TreeSeries_uint32_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1696
 * 
 * 
 *     cdef __TreeSeries_uint32_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1699
 * 
 *         cdef __TreeSeries_uint32_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1699, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1701
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1702
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1705
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1705, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1706
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1705, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1704
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1704, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1707
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1708
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 1708, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1707
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1710
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 1710, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 1710, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1710, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1712
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1713
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1713, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1713, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1713, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1714
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1714, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1712
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1716
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1717
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1716
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1719
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1719, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 1719, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1720
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1722
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1696
 * 
 * 
 *     cdef __TreeSeries_uint32_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1725
 * 
 * 
 *     cdef __TreeSeries_uint32_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1728
 * 
 *         cdef __TreeSeries_uint32_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1730
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1731
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1734
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1734, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1735
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1734, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1733
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1733, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1736
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1736, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1738
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1739
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 1739, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1738
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1741
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 1741, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1741, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 1741, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 1741, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1743
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1744
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 1744, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_unsigned_int(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1744, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1744, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1745
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1745, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1743
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1747
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1748
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":1747
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1750
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 1750, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 1750, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1751
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1753
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1736
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1725
 * 
 * 
 *     cdef __TreeSeries_uint32_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1756
 * 
 * 
 *     cdef __TreeSeries_uint32_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint32_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1764
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1764, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1765
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1764, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1763
 *         cdef object key
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1763, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1766
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1768
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1770
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_uint32_t(node), other[key])
 *             __insert_node_uint32_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1771
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint32_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint32_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1771, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint32_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1772
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint32_t(node), other[key])
 *             __insert_node_uint32_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint32_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1772, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1768
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1774
 *             __insert_node_uint32_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1776
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1756
 * 
 * 
 *     cdef __TreeSeries_uint32_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint32_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1779
 * 
 * 
 *     cdef __TreeSeries_uint32_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint32_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1785
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 1785, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1788
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1788, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1789
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1788, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1787
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_uint32_t result
 *         result = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1787, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1791
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1792
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1793
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1794
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1795
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1795, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 1795, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1797
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1798
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1800
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1801
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint32_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1802
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint32_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1802, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1802, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1802, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 1802, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1802, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1802, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1802, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1803
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint32_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint32_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1803, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1804
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint32_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1806
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1807
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1809
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_uint64_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1779
 * 
 * 
 *     cdef __TreeSeries_uint32_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint32_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1214
 *     cdef arithmetic_type_uint32_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 1214, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1215
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   uint32_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 1215, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1216
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   uint32_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1217
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   uint32_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1217, __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("redblackpy.series.tree_series.__TreeSeries_uint32_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(3, 1217, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint32_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1823
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1827
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint64_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 1827, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(values[4]); if (unlikely((__pyx_v_extrapolate == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 1828, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1827, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 1827, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 1828, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 1828, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1830
 *                    str interpolate="floor", uint64_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1831
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1832
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1833
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1835
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1836
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1838
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1840
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1841
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1841, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 1841, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1840
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1838
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1844
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1845
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1845, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1844
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1848
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1848, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1827
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint64_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1855
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint64_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1855, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1855, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1855, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1855, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1855, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1857
 *     cpdef void insert(self, key, uint64_t value) except*:
 * 
 *         __insert_node_uint64_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1857, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1855
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint64_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 1855, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 1855, __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_value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 1855, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1855, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1855, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1855, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1860
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1860, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1860, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1860, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1860, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1864
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint64_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 1864, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 1864, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1864, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1865
 * 
 *         for pair in pairs:
 *             __insert_node_uint64_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1865, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1865, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 1865, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1865, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1864
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint64_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1860
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 1860, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1860, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1860, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1868
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint64_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1868, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1868, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1868, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1868, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1868, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1870
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_uint64_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1870, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1868
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint64_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1868, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1868, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1873
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1873, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1873, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1873, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1873, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1873, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1877
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_uint64_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 1877, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 1877, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1878
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_uint64_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 1878, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1878, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1873
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 1873, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1873, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1873, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1881
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1881, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1881, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1881, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1884
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1886
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint64_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1887
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_uint64_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 1887, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1886
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint64_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1889
 *             result.append( __deref_value_ptr_uint64_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1881
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1881, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1892
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1892, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1892, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1892, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1895
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1897
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint64_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1898
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint64_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1899
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint64_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1898
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint64_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 1898, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1897
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint64_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1901
 *                              __deref_value_ptr_uint64_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1892
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1892, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_18generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":1904
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 1904, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_18generator6, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_uint64_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 1904, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_18generator6(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 1904, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1908
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint64_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1909
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint64_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 1909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 1909, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1908
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint64_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1904
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1912
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1912, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1912, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1912, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1912, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1912, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1912, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1916
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1917
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1917, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1919
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1920
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__38);
    __pyx_r = __pyx_tuple__38;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1919
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1922
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint64_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1923
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_uint64_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1922
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint64_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1912
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.floor", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1912, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1926
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1926, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1926, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1926, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1926, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 1926, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1926, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 1926, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1930
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1931
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1931, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1933
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1934
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__39);
    __pyx_r = __pyx_tuple__39;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1933
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1936
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint64_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1937
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_uint64_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1936
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint64_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1936, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1926
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.ceil", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1926, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1940
 * 
 * 
 *     cpdef __TreeSeries_uint64_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1940, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1940, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1940, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1940, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 1940, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1948
 *         cdef __TreeSeries_uint64_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1949
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1952
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1952, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1953
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1952, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1951
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1951, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1955
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1955, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1956
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 1956, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1957
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1958
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1960
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1961
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1960
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1963
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1960
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1965
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 1965, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1966
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1965
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1968
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint64_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1969
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_uint64_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 1969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1970
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint64_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1969, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1972
 *                            __deref_value_ptr_uint64_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1973
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":1972
 *                            __deref_value_ptr_uint64_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1975
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1977
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1940
 * 
 * 
 *     cpdef __TreeSeries_uint64_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 1940, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 1940, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1940, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1940, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1980
 * 
 * 
 *     cpdef __TreeSeries_uint64_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1980, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1980, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1980, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1980, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1980, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 1980, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1983
 * 
 *         cdef __TreeSeries_uint64_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1985
 *         cdef object it = start
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 1985, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1986
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 1985, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1984
 *         cdef __TreeSeries_uint64_t result
 *         cdef object it = start
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1984, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1988
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1990
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1990, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 1990, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1991
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1991, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1991, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1991, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 1991, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 1991, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":1992
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1994
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1996
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1980
 * 
 * 
 *     cpdef __TreeSeries_uint64_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 1980, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 1980, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 1980, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1980, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1980, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1999
 * 
 * 
 *     cpdef __TreeSeries_uint64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__40;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1999, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1999, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 1999, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1999, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 1999, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2006
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2006, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2006, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2007
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2006, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2005
 *         cdef tuple it
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2005, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2009
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 2009, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 2009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2009, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2010
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2010, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2010, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 2010, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 2010, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2010, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2010, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2012
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1999
 * 
 * 
 *     cpdef __TreeSeries_uint64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__40;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 1999, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 1999, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 1999, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 2000, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1999, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2015
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__41;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2015, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2015, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2015, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2015, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2020
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2021
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2022
 *         for it in deref(self.__index):
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 2022, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2021
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2022
 *         for it in deref(self.__index):
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 2022, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2021
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2021, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_uint64_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2021, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2020
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint64_t( it, method( __deref_value_ptr_uint64_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2015
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__41;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 2015, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2015, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 2015, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 2016, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2015, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2025
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2025, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2025, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2025, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2025, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2025, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2027
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint64_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2027, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2027, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2028
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_uint64_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2029
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint64_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2025
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint64_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 2025, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2025, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2032
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2032, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2032, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2032, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2032, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2032, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2034
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 2034, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2035
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2034
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2037
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 2037, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2038
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2037
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2032
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint64_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 2032, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2032, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2041
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2041, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2041, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2041, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2043
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2044
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2041
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint64_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2041, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2047
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2047, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2047, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2049
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2050
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2047
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint64_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2047, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2053
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2053, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2053, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2053, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2053, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2053, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2057
 *         cdef tuple it
 *         cdef uint64_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2057, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2059
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 2059, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2061
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <uint64_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2061, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 2061, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2061, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2062
 * 
 *             for it in other.iteritems():
 *                 num = <uint64_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2062, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 2062, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2063
 *             for it in other.iteritems():
 *                 num = <uint64_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2063, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2063, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2059
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2065
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 2065, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2066
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2066, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 2066, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2066, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2067
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2067, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2067, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2067, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2067, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2067, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2065
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2070
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2070, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 2070, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2070, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2071
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2071, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2071, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2071, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2071, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2053
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 2053, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2053, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 2053, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2053, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2074
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2074, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2074, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2076
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 2076, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 2076, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2077
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2077, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2076
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2079
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2074
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2074, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2074, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2084
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2086
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2084
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":2089
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2091
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2092
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2092, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2094
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2094, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2096
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 2096, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2096, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2097
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 2097, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 2097, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2097, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2098
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2098, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2098, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2098, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 2098, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2098, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 2098, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2098, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2098, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 2098, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2097
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2096
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2101
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2101, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2101, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 2101, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2101, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2101, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2102
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2102, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 2102, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2102, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 2102, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2102, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 2102, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2101
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2104
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2106
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2106, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 2106, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 2106, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2107
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2107, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 2107, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2107, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 2107, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2107, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2106
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2109
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2089
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_uint64_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2112
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2114
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2114, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2114, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2112
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_51generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":2117
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 2117, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_51generator7, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_uint64_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 2117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_51generator7(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 2117, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2121
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint64_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2122
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_uint64_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 2122, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2121
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint64_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2117
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2125
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2127
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef uint64_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2130
 *         cdef uint64_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2131
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2130
 *         cdef uint64_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2133
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2134
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2133
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2136
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2138
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2139
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2138
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2141
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2142
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2142, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 2142, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2141
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2144
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2145
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 2145, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2144
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2125
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2148
 * 
 * 
 *     def __setitem__(self, key, uint64_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2148, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2150
 *     def __setitem__(self, key, uint64_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2151
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2151, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2153
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint64_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2154
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_uint64_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2154, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2153
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint64_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2157
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint64_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2157, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 2157, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2158
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_uint64_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_uint64_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2158, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2157
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint64_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2161
 * 
 *             else:
 *                 __insert_node_by_ptr_uint64_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2161, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2148
 * 
 * 
 *     def __setitem__(self, key, uint64_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2167
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint64_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2167, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2167, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2167, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2167, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 2167, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2169
 *     cpdef __TreeSeries_uint64_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_uint64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_uint64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2169, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2167
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint64_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2167, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2167, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2172
 * 
 * 
 *     cpdef __TreeSeries_uint64_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2172, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2172, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2172, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 2172, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2174
 *     cpdef __TreeSeries_uint64_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_uint64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_uint64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2174, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2172
 * 
 * 
 *     cpdef __TreeSeries_uint64_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2172, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2172, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2177
 * 
 * 
 *     cpdef __TreeSeries_uint64_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2177, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2177, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2177, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2177, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2177, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 2177, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2179
 *     cpdef __TreeSeries_uint64_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_uint64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_uint64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2179, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2177
 * 
 * 
 *     cpdef __TreeSeries_uint64_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2177, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2177, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2182
 * 
 * 
 *     cpdef __TreeSeries_uint64_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2182, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2182, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2182, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2182, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 2182, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2184
 *     cpdef __TreeSeries_uint64_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_uint64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_uint64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2182
 * 
 * 
 *     cpdef __TreeSeries_uint64_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2182, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2182, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2187
 * 
 * 
 *     cpdef __TreeSeries_uint64_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2187, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2187, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2187, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2187, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 2187, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2189
 *     cpdef __TreeSeries_uint64_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2190
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2190, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2189
 *     cpdef __TreeSeries_uint64_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2187
 * 
 * 
 *     cpdef __TreeSeries_uint64_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2187, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2193
 * 
 * 
 *     cpdef __TreeSeries_uint64_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2193, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2193, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2193, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t))))) __PYX_ERR(3, 2193, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2195
 *     cpdef __TreeSeries_uint64_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2196
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2196, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2195
 *     cpdef __TreeSeries_uint64_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2193
 * 
 * 
 *     cpdef __TreeSeries_uint64_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2193, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2202
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2206
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2206, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2206, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2207
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 2207, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2206
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2209
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2209, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 2209, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2209, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 2209, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2209, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 2209, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 2209, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2210
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2210, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2210, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2210, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2210, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2209
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2202
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2213
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2215
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2215, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 2215, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 2215, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2215, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 2215, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2216
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2216, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2215
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2213
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2219
 * 
 * 
 *     cdef uint64_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2222
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2225
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2225, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2226
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2228
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2229
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2228
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2232
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2234
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2219
 * 
 * 
 *     cdef uint64_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint64_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2239
 * 
 * 
 *     cdef uint64_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2241
 *     cdef uint64_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2244
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2244, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2245
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2247
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2239
 * 
 * 
 *     cdef uint64_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint64_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2252
 * 
 * 
 *     cdef __TreeSeries_uint64_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2255
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint64_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2256
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2259
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2259, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2260
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2259, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2258
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2258, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2262
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2262, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2262, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2262, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 2262, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2263
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2262
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2265
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2267
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2267, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2268
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2267
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2270
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2270, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2271
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2270
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2265
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2273
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2274
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2275
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 2275, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2273
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2277
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2278
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2278, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2279
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 2279, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2277
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2281
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2282
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2281
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2284
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2281
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2286
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2287
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2286
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2289
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2290
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2291
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2290
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2290, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2289
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2294
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2295
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2296
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2294
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 2294, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2252
 * 
 * 
 *     cdef __TreeSeries_uint64_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2299
 * 
 * 
 *     cdef __TreeSeries_uint64_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2302
 * 
 *         cdef __TreeSeries_uint64_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2304
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2305
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2308
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2308, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2308, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2309
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2308, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2307
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2307, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2310
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2311
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 2311, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2310
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2313
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 2313, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 2313, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2313, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2315
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2316
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2316, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2316, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2316, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2317
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2317, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2315
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2319
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2320
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2319
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2322
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2322, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 2322, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2323
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2325
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2299
 * 
 * 
 *     cdef __TreeSeries_uint64_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2328
 * 
 * 
 *     cdef __TreeSeries_uint64_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2331
 * 
 *         cdef __TreeSeries_uint64_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2333
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2334
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2337
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2337, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2338
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2337, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2336
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2336, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2339
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2341
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2342
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 2342, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2341
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2344
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2344, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 2344, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2344, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2346
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2347
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 2347, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2347, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2347, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2348
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2348, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2346
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2350
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2351
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2350
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2353
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2353, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 2353, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2354
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2356
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2339
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2328
 * 
 * 
 *     cdef __TreeSeries_uint64_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2359
 * 
 * 
 *     cdef __TreeSeries_uint64_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint64_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2367
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2367, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2368
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2367, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2366
 *         cdef object key
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2366, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2369
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2371
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2373
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_uint64_t(node), other[key])
 *             __insert_node_uint64_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2374
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint64_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint64_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_6 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2374, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint64_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2375
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint64_t(node), other[key])
 *             __insert_node_uint64_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint64_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2375, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2371
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2377
 *             __insert_node_uint64_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2379
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2359
 * 
 * 
 *     cdef __TreeSeries_uint64_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint64_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2382
 * 
 * 
 *     cdef __TreeSeries_uint64_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint64_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2388
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 2388, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2391
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2391, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2392
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2391, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2390
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_uint64_t result
 *         result = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2390, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2394
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2395
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2396
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2397
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2398
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2398, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 2398, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2400
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2401
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2403
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2404
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint64_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2405
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint64_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2405, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2405, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2405, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 2405, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2405, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2405, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_11 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2405, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2406
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint64_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint64_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2406, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2407
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint64_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2409
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2410
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2412
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_uint96_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2382
 * 
 * 
 *     cdef __TreeSeries_uint64_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint64_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":1817
 *     cdef arithmetic_type_uint64_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 1817, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1818
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   uint64_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 1818, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1819
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   uint64_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":1820
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   uint64_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 1820, __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("redblackpy.series.tree_series.__TreeSeries_uint64_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 1820, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint64_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2426
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":2430
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint96_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 2430, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(values[4]); if (unlikely((__pyx_v_extrapolate == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2431, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2430, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 2430, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 2431, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 2431, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2433
 *                    str interpolate="floor", uint96_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2434
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2435
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2436
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2438
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2439
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2441
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2443
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2444
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2444, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 2444, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2443
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2441
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2447
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2448
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2448, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2447
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2451
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2451, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2430
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint96_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2458
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint96_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2458, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2458, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 2458, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2458, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2460
 *     cpdef void insert(self, key, uint96_t value) except*:
 * 
 *         __insert_node_uint96_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2460, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2458
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint96_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 2458, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 2458, __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_value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2458, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2458, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2458, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2458, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2463
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2463, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2463, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2463, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2467
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint96_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 2467, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 2467, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2467, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2468
 * 
 *         for pair in pairs:
 *             __insert_node_uint96_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2468, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2468, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2468, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2468, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2467
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint96_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2463
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 2463, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2463, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2463, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2471
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint96_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2471, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2471, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2471, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2471, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2471, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2471, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2473
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_uint96_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2473, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2471
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint96_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2471, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2471, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2476
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2476, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2476, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2476, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2476, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2476, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2480
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_uint96_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 2480, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2480, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2481
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_uint96_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2481, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2481, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2476
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 2476, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2476, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2476, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2484
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2484, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2484, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2484, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2487
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2489
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint96_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2490
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_uint96_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 2490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2489
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint96_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2492
 *             result.append( __deref_value_ptr_uint96_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2484
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2484, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2495
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2495, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2495, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2495, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2498
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2500
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint96_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2501
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint96_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2502
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint96_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2501
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint96_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 2501, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2500
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint96_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2504
 *                              __deref_value_ptr_uint96_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2495
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2495, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_18generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":2507
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 2507, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_18generator8, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_uint96_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 2507, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_18generator8(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 2507, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2511
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint96_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2512
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint96_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 2512, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2511
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint96_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2507
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2515
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2515, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2515, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2515, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2515, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2515, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2515, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2519
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2520
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2520, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2522
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2523
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__48);
    __pyx_r = __pyx_tuple__48;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2522
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2525
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint96_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2526
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_uint96_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2525
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint96_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2515
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.floor", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2515, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2529
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2529, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2529, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2529, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2529, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2529, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2529, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2529, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2533
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2534
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2534, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2536
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2537
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__49);
    __pyx_r = __pyx_tuple__49;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2536
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2539
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint96_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2540
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_uint96_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2539
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint96_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2529
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.ceil", __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_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2529, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2543
 * 
 * 
 *     cpdef __TreeSeries_uint96_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2543, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2543, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2543, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2543, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2543, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2551
 *         cdef __TreeSeries_uint96_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2552
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2555
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2555, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2556
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2555, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2554
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2554, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2558
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2558, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2559
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2559, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2560
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2561
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2563
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2564
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2563
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2566
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2563
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2568
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 2568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2569
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2568
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2571
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint96_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2572
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_uint96_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2573
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint96_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2572, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2575
 *                            __deref_value_ptr_uint96_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2576
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2575
 *                            __deref_value_ptr_uint96_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2578
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2580
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2543
 * 
 * 
 *     cpdef __TreeSeries_uint96_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 2543, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 2543, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2543, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2543, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2583
 * 
 * 
 *     cpdef __TreeSeries_uint96_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2583, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2583, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2583, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2583, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2583, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2586
 * 
 *         cdef __TreeSeries_uint96_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2588
 *         cdef object it = start
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2588, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2589
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2588, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2587
 *         cdef __TreeSeries_uint96_t result
 *         cdef object it = start
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2587, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2591
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2593
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2593, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 2593, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2594
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2594, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2594, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2595
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2597
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2599
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2583
 * 
 * 
 *     cpdef __TreeSeries_uint96_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 2583, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 2583, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 2583, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2583, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2583, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2602
 * 
 * 
 *     cpdef __TreeSeries_uint96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__50;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2602, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2602, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2602, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2609
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2609, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2609, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2610
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2609, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2608
 *         cdef tuple it
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2608, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2612
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 2612, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 2612, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2612, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2613
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2613, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2613, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 2613, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 2613, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2613, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2613, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2615
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2602
 * 
 * 
 *     cpdef __TreeSeries_uint96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__50;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 2602, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2602, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 2602, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 2603, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2602, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2618
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__51;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2618, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2618, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2618, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2623
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2624
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2625
 *         for it in deref(self.__index):
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 2625, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2624
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2625
 *         for it in deref(self.__index):
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 2625, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2624
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2624, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_uint96_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2624, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2623
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint96_t( it, method( __deref_value_ptr_uint96_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2618
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__51;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 2618, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2618, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 2618, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 2619, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2618, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2628
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2628, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2628, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2628, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2628, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2630
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint96_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2631
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_uint96_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2632
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint96_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2628
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint96_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 2628, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2628, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2635
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2635, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2635, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2635, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2635, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2635, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2637
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 2637, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2638
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2637
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2640
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 2640, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2641
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2640
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2635
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint96_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 2635, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2635, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2644
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2644, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2644, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2646
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2647
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2644
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint96_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2644, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2650
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2650, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2650, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2652
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2653
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2650
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint96_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2650, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2656
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2656, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2656, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2656, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2656, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2656, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2660
 *         cdef tuple it
 *         cdef uint96_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2660, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2662
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 2662, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2664
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <uint96_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2664, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 2664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2664, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2665
 * 
 *             for it in other.iteritems():
 *                 num = <uint96_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2665, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 2665, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2666
 *             for it in other.iteritems():
 *                 num = <uint96_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2666, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2666, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2662
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2668
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 2668, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2669
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2669, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 2669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2669, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2670
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2670, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2670, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2670, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2670, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2668
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2673
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2673, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 2673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2673, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2674
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2674, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2674, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2674, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2674, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2656
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 2656, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 2656, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 2656, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2656, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2656, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2677
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2677, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2677, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2679
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2679, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 2679, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 2679, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2680
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2680, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2679
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2682
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2677
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2677, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2677, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2687
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2689
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2687
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":2692
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2694
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2695
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2697
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2697, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2699
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 2699, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2699, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2700
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 2700, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 2700, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2700, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2701
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2701, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 2701, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2701, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 2701, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 2701, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2700
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2699
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2704
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2704, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2704, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 2704, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2704, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 2704, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2705
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2705, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 2705, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2705, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 2705, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2705, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 2705, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2704
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2707
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2709
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2709, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 2709, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 2709, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2710
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2710, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 2710, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2710, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 2710, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2710, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2709
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2712
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2692
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_uint96_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2715
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2717
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2717, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2717, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2715
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_51generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":2720
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 2720, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_51generator9, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_uint96_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 2720, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_51generator9(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 2720, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2724
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint96_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2725
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_uint96_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 2725, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2724
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint96_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2720
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2728
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2730
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef uint96_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2733
 *         cdef uint96_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2734
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2733
 *         cdef uint96_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2736
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2737
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2736
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2739
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2741
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2742
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2742, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2741
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2744
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2745
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2745, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 2745, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2744
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2747
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2748
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 2748, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2747
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2728
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2751
 * 
 * 
 *     def __setitem__(self, key, uint96_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2751, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2753
 *     def __setitem__(self, key, uint96_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2754
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2754, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2756
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint96_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2757
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_uint96_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2757, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2756
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint96_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2760
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint96_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2760, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 2760, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2761
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_uint96_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_uint96_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2761, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2760
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint96_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2764
 * 
 *             else:
 *                 __insert_node_by_ptr_uint96_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2764, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2751
 * 
 * 
 *     def __setitem__(self, key, uint96_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2770
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint96_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2770, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2770, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2770, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2770, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2770, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2770, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2770, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2772
 *     cpdef __TreeSeries_uint96_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_uint96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_uint96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2772, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2770
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint96_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2770, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2770, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2775
 * 
 * 
 *     cpdef __TreeSeries_uint96_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2775, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2775, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2775, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2775, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2775, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2775, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2777
 *     cpdef __TreeSeries_uint96_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_uint96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_uint96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2777, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2775
 * 
 * 
 *     cpdef __TreeSeries_uint96_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2775, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2775, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2780
 * 
 * 
 *     cpdef __TreeSeries_uint96_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2780, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2780, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2780, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2780, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2780, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2780, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2780, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2782
 *     cpdef __TreeSeries_uint96_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_uint96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_uint96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2782, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2780
 * 
 * 
 *     cpdef __TreeSeries_uint96_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2780, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2780, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2785
 * 
 * 
 *     cpdef __TreeSeries_uint96_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2785, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2785, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2785, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2787
 *     cpdef __TreeSeries_uint96_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_uint96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_uint96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2785
 * 
 * 
 *     cpdef __TreeSeries_uint96_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 2785, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2785, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2790
 * 
 * 
 *     cpdef __TreeSeries_uint96_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2790, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2790, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2790, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2790, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2790, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2792
 *     cpdef __TreeSeries_uint96_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2793
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2793, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2792
 *     cpdef __TreeSeries_uint96_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2790
 * 
 * 
 *     cpdef __TreeSeries_uint96_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2790, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2796
 * 
 * 
 *     cpdef __TreeSeries_uint96_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2796, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2796, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2796, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2796, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2796, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2796, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t))))) __PYX_ERR(3, 2796, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2798
 *     cpdef __TreeSeries_uint96_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2799
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 2799, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2799, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2798
 *     cpdef __TreeSeries_uint96_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2796
 * 
 * 
 *     cpdef __TreeSeries_uint96_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2796, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2805
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2809
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2809, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 2809, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2810
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 2810, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2809
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2812
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2812, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 2812, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 2812, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 2812, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 2812, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 2812, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 2812, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2813
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2813, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2813, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2813, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2813, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2812
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2805
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2816
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2818
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2818, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 2818, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 2818, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 2818, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 2818, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2819
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2819, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2818
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2816
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2822
 * 
 * 
 *     cdef uint96_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2825
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2828
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2828, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2829
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2831
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2832
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2831
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2835
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2837
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2822
 * 
 * 
 *     cdef uint96_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint96_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2842
 * 
 * 
 *     cdef uint96_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2844
 *     cdef uint96_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2847
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 2847, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2848
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2850
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2842
 * 
 * 
 *     cdef uint96_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint96_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2855
 * 
 * 
 *     cdef __TreeSeries_uint96_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2858
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint96_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2859
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2862
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2862, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2863
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2862, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2861
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2861, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2865
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2865, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2865, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 2865, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2866
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2865
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2868
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2868, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2870
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2870, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2871
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2870
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2873
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 2873, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2874
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2873
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2868
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2876
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2877
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2878
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 2878, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2876
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2880
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2881
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2881, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2882
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 2882, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2880
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2884
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2885
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2884
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2887
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2884
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2889
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2890
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2889
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2892
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2893
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2894
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2893
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2892
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2897
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2898
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2899
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2899, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2897
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 2897, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2855
 * 
 * 
 *     cdef __TreeSeries_uint96_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2902
 * 
 * 
 *     cdef __TreeSeries_uint96_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2905
 * 
 *         cdef __TreeSeries_uint96_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2907
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2908
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2911
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2911, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2911, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2912
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2911, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2910
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2910, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2913
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2914
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 2914, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2913
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2916
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 2916, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 2916, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2916, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2918
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2919
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2919, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2919, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2919, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2920
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2920, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2918
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2922
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2923
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2922
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2925
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 2925, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 2925, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2926
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2928
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2902
 * 
 * 
 *     cdef __TreeSeries_uint96_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2931
 * 
 * 
 *     cdef __TreeSeries_uint96_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2934
 * 
 *         cdef __TreeSeries_uint96_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2936
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2937
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2940
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2940, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2940, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2941
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2940, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2939
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2939, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2942
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2944
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2945
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 2945, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2944
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2947
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 2947, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2947, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 2947, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 2947, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2949
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2950
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 2950, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2950, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2950, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2951
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2951, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2949
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2953
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2954
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":2953
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2956
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 2956, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 2956, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":2957
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2959
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2942
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2931
 * 
 * 
 *     cdef __TreeSeries_uint96_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2962
 * 
 * 
 *     cdef __TreeSeries_uint96_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint96_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2970
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2970, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2971
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2970, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2969
 *         cdef object key
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2969, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2972
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2974
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2976
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_uint96_t(node), other[key])
 *             __insert_node_uint96_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2977
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint96_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint96_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_6 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2977, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint96_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2978
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint96_t(node), other[key])
 *             __insert_node_uint96_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint96_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 2978, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":2974
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2980
 *             __insert_node_uint96_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2982
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2962
 * 
 * 
 *     cdef __TreeSeries_uint96_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint96_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2985
 * 
 * 
 *     cdef __TreeSeries_uint96_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint96_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2991
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 2991, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2994
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 2994, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2995
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 2994, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2993
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_uint96_t result
 *         result = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 2993, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2997
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2998
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2999
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3000
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3001
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3001, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 3001, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3003
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3004
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3006
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3007
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint96_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3008
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint96_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3008, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3008, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3008, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 3008, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3008, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3008, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3008, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_11 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3008, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3009
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint96_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint96_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3009, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3010
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint96_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3012
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3013
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3015
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_uint128_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2985
 * 
 * 
 *     cdef __TreeSeries_uint96_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint96_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":2420
 *     cdef arithmetic_type_uint96_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 2420, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":2421
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   uint96_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 2421, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":2422
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   uint96_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":2423
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   uint96_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 2423, __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("redblackpy.series.tree_series.__TreeSeries_uint96_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 2423, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint96_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3029
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3033
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint128_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 3033, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(values[4]); if (unlikely((__pyx_v_extrapolate == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3034, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3033, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 3033, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 3034, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 3034, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3036
 *                    str interpolate="floor", uint128_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3037
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3038
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3039
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3041
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3042
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3044
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3046
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3047
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3047, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 3047, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3046
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3044
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3050
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3051
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3051, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3050
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3054
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3054, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3033
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", uint128_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3061
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint128_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3061, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3061, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3061, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3061, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 3061, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3061, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3063
 *     cpdef void insert(self, key, uint128_t value) except*:
 * 
 *         __insert_node_uint128_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3063, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3061
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, uint128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_uint128_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 3061, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 3061, __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_value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3061, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3061, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3061, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3061, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3066
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3066, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3066, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3066, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3066, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3066, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3070
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint128_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 3070, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 3070, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3070, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3070, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3071
 * 
 *         for pair in pairs:
 *             __insert_node_uint128_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3071, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3071, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3071, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3070
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_uint128_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3066
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 3066, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3066, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3066, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3074
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint128_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3074, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3074, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3074, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3074, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3074, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3076
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_uint128_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3076, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3074
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_uint128_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3074, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3074, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3079
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3079, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3079, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3079, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3079, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3079, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3083
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_uint128_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 3083, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 3083, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3084
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_uint128_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3084, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_uint128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3084, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3079
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 3079, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3079, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3079, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3087
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3087, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3087, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3087, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3090
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3090, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3092
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint128_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3093
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_uint128_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3093, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 3093, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3092
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_uint128_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3095
 *             result.append( __deref_value_ptr_uint128_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3087
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3087, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3098
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3098, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3098, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3098, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3101
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3103
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint128_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3104
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint128_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3105
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint128_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3104
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_uint128_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 3104, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3103
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_uint128_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3107
 *                              __deref_value_ptr_uint128_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3098
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3098, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_18generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":3110
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 3110, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_18generator10, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_uint128_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 3110, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_18generator10(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3110, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3114
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint128_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3115
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint128_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3115, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3114
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_uint128_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3110
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3118
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3118, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3118, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3118, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3118, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3118, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3118, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3122
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3123
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3123, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3125
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3126
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__58);
    __pyx_r = __pyx_tuple__58;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3125
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3128
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint128_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3129
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_uint128_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3128
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint128_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3118
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.floor", __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_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3118, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3132
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3132, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3132, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3132, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3132, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3132, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3132, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3132, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3136
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3137
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3137, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3139
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3140
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__59);
    __pyx_r = __pyx_tuple__59;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3139
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3142
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint128_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3143
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_uint128_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3142
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_uint128_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3142, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3132
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.ceil", __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_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3132, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3146
 * 
 * 
 *     cpdef __TreeSeries_uint128_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3146, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3146, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3146, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3146, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3154
 *         cdef __TreeSeries_uint128_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3155
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3158
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3158, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3159
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3158, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3157
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3157, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3161
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3161, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3162
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3162, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3163
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3164
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3166
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3167
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3166
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3169
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3166
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3171
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3171, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 3171, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3172
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3171
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3174
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint128_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3175
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_uint128_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3176
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_uint128_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3175, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3178
 *                            __deref_value_ptr_uint128_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3179
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3178
 *                            __deref_value_ptr_uint128_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3181
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3183
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3146
 * 
 * 
 *     cpdef __TreeSeries_uint128_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 3146, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 3146, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3146, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3146, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3186
 * 
 * 
 *     cpdef __TreeSeries_uint128_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3186, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3186, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3186, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3186, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3186, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3189
 * 
 *         cdef __TreeSeries_uint128_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3191
 *         cdef object it = start
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3191, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3192
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3191, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3190
 *         cdef __TreeSeries_uint128_t result
 *         cdef object it = start
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3190, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3194
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3196
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3196, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 3196, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3197
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3197, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3197, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3197, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3197, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3197, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3198
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3200
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3202
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3186
 * 
 * 
 *     cpdef __TreeSeries_uint128_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 3186, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 3186, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 3186, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3186, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3186, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3205
 * 
 * 
 *     cpdef __TreeSeries_uint128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__60;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3205, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3205, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3205, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3212
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3212, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3213
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3212, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3211
 *         cdef tuple it
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3211, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3215
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 3215, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 3215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3215, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3216
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3216, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3216, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 3216, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 3216, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3216, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3218
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3205
 * 
 * 
 *     cpdef __TreeSeries_uint128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__60;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 3205, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3205, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 3205, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 3206, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3205, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3221
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__61;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3221, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3221, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3221, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3226
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3227
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3228
 *         for it in deref(self.__index):
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 3228, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3227
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3228
 *         for it in deref(self.__index):
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 3228, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3227
 * 
 *         for it in deref(self.__index):
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_uint128_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3227, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3226
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_uint128_t( it, method( __deref_value_ptr_uint128_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3221
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__61;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 3221, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3221, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 3221, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 3222, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3221, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3231
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3231, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3231, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3231, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3231, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3233
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint128_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3233, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3233, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3234
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_uint128_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3235
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_uint128_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3231
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint128_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 3231, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3231, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3238
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3238, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3238, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3238, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3238, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3238, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3240
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 3240, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3241
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3240
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3243
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 3243, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3244
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3243
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3238
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint128_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 3238, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3238, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3247
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3247, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3247, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3247, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3249
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3250
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3247
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint128_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3247, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3253
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3253, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3253, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3255
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3256
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3253
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint128_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3253, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3259
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3259, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3259, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3259, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3263
 *         cdef tuple it
 *         cdef uint128_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3263, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3265
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 3265, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3267
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <uint128_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3267, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 3267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3267, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3268
 * 
 *             for it in other.iteritems():
 *                 num = <uint128_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3268, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 3268, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3269
 *             for it in other.iteritems():
 *                 num = <uint128_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3269, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3269, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3265
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3271
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 3271, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3272
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3272, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 3272, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3272, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3273
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3273, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3273, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3273, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3273, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3273, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3271
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3276
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3276, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 3276, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3276, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3277
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3277, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3277, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3277, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3277, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3259
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 3259, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3259, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 3259, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3259, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3259, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3280
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3280, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3280, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3282
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3282, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 3282, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 3282, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3283
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3283, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3282
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3285
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3280
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3280, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3280, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3290
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3292
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3290
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3295
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3297
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3298
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3298, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3300
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3302
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 3302, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 3302, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3303
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 3303, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 3303, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3303, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3304
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3304, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 3304, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3304, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 3304, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3304, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 3304, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3303
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3302
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3307
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3307, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 3307, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3307, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3307, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3308
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3308, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 3308, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3308, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 3308, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 3308, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3307
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3310
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3312
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3312, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 3312, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3312, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 3312, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3313
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3313, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 3313, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3313, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 3313, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3313, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3313, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3312
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3315
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3295
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_uint128_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3318
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3320
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3320, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3320, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3318
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_51generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":3323
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 3323, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_51generator11, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_uint128_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 3323, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_51generator11(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3323, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3327
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint128_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3328
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_uint128_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3328, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3327
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_uint128_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3323
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3331
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3333
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef uint128_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3336
 *         cdef uint128_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3337
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3336
 *         cdef uint128_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3339
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3340
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3339
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3342
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3344
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3345
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3344
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3347
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3348
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3348, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 3348, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3347
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3350
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3351
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 3351, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3350
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3331
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3354
 * 
 * 
 *     def __setitem__(self, key, uint128_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_arg_value); if (unlikely((__pyx_v_value == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3354, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3356
 *     def __setitem__(self, key, uint128_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3357
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3357, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3359
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint128_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3360
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_uint128_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3360, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3359
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_uint128_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3363
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint128_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 3363, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3364
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_uint128_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_uint128_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3364, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3363
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_uint128_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3367
 * 
 *             else:
 *                 __insert_node_by_ptr_uint128_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_uint128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3367, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3354
 * 
 * 
 *     def __setitem__(self, key, uint128_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3373
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint128_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3373, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3373, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3373, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3373, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3373, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3373, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3375
 *     cpdef __TreeSeries_uint128_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_uint128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_uint128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3375, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3373
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_uint128_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_uint128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3373, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3373, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3378
 * 
 * 
 *     cpdef __TreeSeries_uint128_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3378, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3378, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3378, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3380
 *     cpdef __TreeSeries_uint128_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_uint128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_uint128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3378
 * 
 * 
 *     cpdef __TreeSeries_uint128_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_uint128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3378, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3378, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3383
 * 
 * 
 *     cpdef __TreeSeries_uint128_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3383, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3383, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3383, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3383, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3383, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3385
 *     cpdef __TreeSeries_uint128_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_uint128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_uint128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3385, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3383
 * 
 * 
 *     cpdef __TreeSeries_uint128_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_uint128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3383, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3383, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3388
 * 
 * 
 *     cpdef __TreeSeries_uint128_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3388, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3388, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3388, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3388, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3388, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3390
 *     cpdef __TreeSeries_uint128_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_uint128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_uint128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3388
 * 
 * 
 *     cpdef __TreeSeries_uint128_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_uint128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3388, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3388, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3393
 * 
 * 
 *     cpdef __TreeSeries_uint128_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3393, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3393, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3393, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3393, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3393, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3395
 *     cpdef __TreeSeries_uint128_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3396
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 3396, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3395
 *     cpdef __TreeSeries_uint128_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3393
 * 
 * 
 *     cpdef __TreeSeries_uint128_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3393, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3399
 * 
 * 
 *     cpdef __TreeSeries_uint128_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3399, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3399, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3399, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3399, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t))))) __PYX_ERR(3, 3399, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3401
 *     cpdef __TreeSeries_uint128_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3402
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 3402, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3401
 *     cpdef __TreeSeries_uint128_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3399
 * 
 * 
 *     cpdef __TreeSeries_uint128_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3399, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3408
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3412
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 3412, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 3412, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3413
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 3413, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3412
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3415
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3415, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3415, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 3415, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3415, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 3415, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3415, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 3415, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 3415, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3416
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3416, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3416, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3416, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3416, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3415
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3408
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3419
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3421
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3421, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 3421, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 3421, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 3421, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3422
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3422, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3421
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3419
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3425
 * 
 * 
 *     cdef uint128_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3428
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3431
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3431, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3432
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3434
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3435
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3434
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3438
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3440
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3425
 * 
 * 
 *     cdef uint128_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint128_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3445
 * 
 * 
 *     cdef uint128_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3447
 *     cdef uint128_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3450
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3450, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3451
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3453
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3445
 * 
 * 
 *     cdef uint128_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_uint128_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3458
 * 
 * 
 *     cdef __TreeSeries_uint128_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3461
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint128_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3462
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3465
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3465, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3466
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3465, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3464
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3464, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3468
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3468, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3468, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3468, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 3468, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3469
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3468
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3471
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3471, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3473
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 3473, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3474
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3473
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3476
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 3476, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3477
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3476
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3471
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3479
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3479, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3480
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3481
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 3481, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3479
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3483
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3484
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3484, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3485
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 3485, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3483
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3487
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3488
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3487
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3490
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3487
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3492
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3493
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3492
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3495
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3496
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3497
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3496
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3496, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3495
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3500
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3501
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3502
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3502, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3500
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 3500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3458
 * 
 * 
 *     cdef __TreeSeries_uint128_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3505
 * 
 * 
 *     cdef __TreeSeries_uint128_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3508
 * 
 *         cdef __TreeSeries_uint128_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3508, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3510
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3511
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3514
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3514, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3514, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3515
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3514, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3513
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3513, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3516
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3517
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 3517, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3516
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3519
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 3519, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 3519, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3519, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3521
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3522
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3522, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3522, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3522, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3523
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3523, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3521
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3525
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3526
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3525
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3528
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3528, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 3528, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3529
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3531
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3505
 * 
 * 
 *     cdef __TreeSeries_uint128_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3534
 * 
 * 
 *     cdef __TreeSeries_uint128_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3537
 * 
 *         cdef __TreeSeries_uint128_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3539
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3540
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3543
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3543, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3543, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3544
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3543, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3542
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3542, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3545
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3547
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3548
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 3548, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3547
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3550
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3550, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3550, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 3550, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3550, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3552
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":3553
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 3553, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3553, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3553, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":3554
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3554, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":3552
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3556
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":3557
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":3556
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3559
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3559, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 3559, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3560
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3562
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3545
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3534
 * 
 * 
 *     cdef __TreeSeries_uint128_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3565
 * 
 * 
 *     cdef __TreeSeries_uint128_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint128_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3573
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3573, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3574
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3573, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3572
 *         cdef object key
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3572, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3575
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3577
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3579
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_uint128_t(node), other[key])
 *             __insert_node_uint128_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3580
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint128_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint128_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_6 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3580, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_uint128_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3581
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_uint128_t(node), other[key])
 *             __insert_node_uint128_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint128_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3581, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3577
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3583
 *             __insert_node_uint128_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3585
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3565
 * 
 * 
 *     cdef __TreeSeries_uint128_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_uint128_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3588
 * 
 * 
 *     cdef __TreeSeries_uint128_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint128_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3594
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 3594, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3597
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3597, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3597, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3598
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3597, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3596
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_uint128_t result
 *         result = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3596, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3600
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3601
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3602
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3603
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3604
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3604, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 3604, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3606
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3607
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3609
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3610
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint128_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3611
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_uint128_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3611, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3611, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 3611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3611, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3611, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3611, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_11 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3611, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3612
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint128_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_uint128_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3612, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3613
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_uint128_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3615
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3616
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3618
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_int8_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3588
 * 
 * 
 *     cdef __TreeSeries_uint128_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_uint128_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3023
 *     cdef arithmetic_type_uint128_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 3023, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3024
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   uint128_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 3024, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3025
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   uint128_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3026
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   uint128_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3026, __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("redblackpy.series.tree_series.__TreeSeries_uint128_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 3026, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_uint128_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3632
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3636
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int8_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 3636, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_signed__char(values[4]); if (unlikely((__pyx_v_extrapolate == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3637, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3636, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 3636, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 3637, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 3637, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3639
 *                    str interpolate="floor", int8_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3640
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3641
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3642
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3644
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3645
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3647
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3649
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3650
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 3650, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3649
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3647
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3653
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3654
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3654, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3653
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3657
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3657, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3636
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int8_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3664
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int8_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3664, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_signed__char(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3664, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3664, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 3664, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3664, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3666
 *     cpdef void insert(self, key, int8_t value) except*:
 * 
 *         __insert_node_int8_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_int8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3666, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3664
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int8_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int8_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 3664, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 3664, __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_value = __Pyx_PyInt_As_signed__char(values[1]); if (unlikely((__pyx_v_value == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3664, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3664, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3664, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3664, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3669
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3669, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3669, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3669, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3669, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3669, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3673
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int8_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 3673, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 3673, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3673, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3673, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3674
 * 
 *         for pair in pairs:
 *             __insert_node_int8_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3674, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3674, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_signed__char(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3674, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3674, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3673
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int8_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3669
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 3669, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3669, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3669, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3677
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int8_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3677, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3677, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3677, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3677, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3679
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_int8_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_int8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3679, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3677
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int8_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3677, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3677, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3682
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3682, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3682, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3682, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3682, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3682, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3686
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_int8_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 3686, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 3686, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3687
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_int8_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3687, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_int8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3687, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3682
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 3682, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3682, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3682, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3690
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3690, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3690, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3690, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3693
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3693, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3695
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int8_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3696
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_int8_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3696, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 3696, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3695
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int8_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3698
 *             result.append( __deref_value_ptr_int8_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3690
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3690, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3701
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3701, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3701, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3701, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3704
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3706
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int8_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3707
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int8_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3708
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int8_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3707
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int8_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 3707, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3706
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int8_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3710
 *                              __deref_value_ptr_int8_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3701
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3701, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_18generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":3713
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 3713, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_18generator12, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_int8_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 3713, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_18generator12(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3713, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3717
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int8_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3718
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int8_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3718, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3717
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int8_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3713
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3721
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3721, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3721, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3721, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3721, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3721, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3721, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3725
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3726
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3726, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3728
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3729
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__68);
    __pyx_r = __pyx_tuple__68;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3728
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3731
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int8_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3732
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_int8_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3731
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int8_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3721
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.floor", __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_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3721, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3735
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3735, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3735, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3735, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3735, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3735, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3735, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3735, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3739
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3740
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3740, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3742
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3743
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__69);
    __pyx_r = __pyx_tuple__69;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3742
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3745
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int8_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3746
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_int8_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3745
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int8_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3745, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3735
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.ceil", __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_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3735, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3749
 * 
 * 
 *     cpdef __TreeSeries_int8_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3749, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3749, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3749, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3749, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3749, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3757
 *         cdef __TreeSeries_int8_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3758
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3761
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3761, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3762
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3761, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3760
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3760, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3764
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3764, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3765
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3765, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3766
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3767
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3769
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3770
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3769
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3772
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3769
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3774
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3774, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 3774, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3775
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3774
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3777
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int8_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3778
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_int8_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3779
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int8_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3778, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3781
 *                            __deref_value_ptr_int8_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3782
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3781
 *                            __deref_value_ptr_int8_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3784
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3786
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3749
 * 
 * 
 *     cpdef __TreeSeries_int8_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 3749, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 3749, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3749, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3749, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3789
 * 
 * 
 *     cpdef __TreeSeries_int8_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3789, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3789, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3789, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3789, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3789, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3792
 * 
 *         cdef __TreeSeries_int8_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3794
 *         cdef object it = start
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3794, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3795
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3794, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3793
 *         cdef __TreeSeries_int8_t result
 *         cdef object it = start
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3793, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3797
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3799
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3799, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 3799, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3800
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3800, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3800, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3800, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3800, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3800, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_signed__char(__pyx_t_2); if (unlikely((__pyx_t_8 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3800, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3800, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3801
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3803
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3805
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3789
 * 
 * 
 *     cpdef __TreeSeries_int8_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 3789, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 3789, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 3789, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3789, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3789, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3808
 * 
 * 
 *     cpdef __TreeSeries_int8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__70;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3808, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3808, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3808, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3808, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3808, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3815
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 3815, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3816
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 3815, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3814
 *         cdef tuple it
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3814, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3818
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 3818, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 3818, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3818, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3819
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3819, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3819, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 3819, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 3819, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_signed__char(__pyx_t_3); if (unlikely((__pyx_t_10 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3819, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3819, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3821
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3808
 * 
 * 
 *     cpdef __TreeSeries_int8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__70;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 3808, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3808, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 3808, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 3809, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3808, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3824
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__71;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3824, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3824, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3824, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3829
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3830
 * 
 *         for it in deref(self.__index):
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3831
 *         for it in deref(self.__index):
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 3831, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3830
 * 
 *         for it in deref(self.__index):
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3831
 *         for it in deref(self.__index):
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 3831, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3830
 * 
 *         for it in deref(self.__index):
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_signed__char(__pyx_t_2); if (unlikely((__pyx_t_10 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3830, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_int8_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3830, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3829
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int8_t( it, method( __deref_value_ptr_int8_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3824
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__71;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 3824, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3824, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 3824, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 3825, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3824, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3834
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3834, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3834, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3834, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3834, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3834, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3836
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int8_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3836, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3836, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3837
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_int8_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3838
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int8_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3834
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int8_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 3834, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3834, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3841
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3841, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3841, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3841, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3841, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3841, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3843
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 3843, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3844
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3843
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3846
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 3846, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3847
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3846
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3841
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int8_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 3841, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3841, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3850
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3850, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3850, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3850, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3852
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3853
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3850
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int8_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3850, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3856
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3856, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3856, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3858
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3859
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3856
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int8_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3856, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3862
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3862, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3862, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3862, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3862, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3866
 *         cdef tuple it
 *         cdef int8_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3866, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3868
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 3868, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3870
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <int8_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3870, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 3870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3870, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3871
 * 
 *             for it in other.iteritems():
 *                 num = <int8_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3871, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 3871, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3872
 *             for it in other.iteritems():
 *                 num = <int8_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3872, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3872, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3868
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3874
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 3874, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3875
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3875, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 3875, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3875, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3876
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3876, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3876, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3876, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_signed__char(__pyx_t_3); if (unlikely((__pyx_t_13 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3876, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3876, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3874
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3879
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 3879, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 3879, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3879, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3880
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3880, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3880, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_signed__char(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3880, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3880, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3862
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 3862, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 3862, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 3862, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3862, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3883
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3883, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3883, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3885
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 3885, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 3885, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3886
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3886, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3885
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3888
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3883
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3883, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3883, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3893
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3895
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3893
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3898
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3900
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3901
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3901, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3903
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3903, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3905
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 3905, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 3905, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3906
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 3906, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 3906, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3906, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3907
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3907, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 3907, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3907, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 3907, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3907, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 3907, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3906
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3905
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3910
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3910, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 3910, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 3910, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3911
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3911, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 3911, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3911, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 3911, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 3911, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 3911, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3910
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3913
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3915
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 3915, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 3915, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3915, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 3915, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3916
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3916, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 3916, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 3916, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 3916, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3916, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 3916, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3915
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3918
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3898
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_int8_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3921
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3923
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3923, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3923, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3923, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3921
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_51generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":3926
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 3926, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_51generator13, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_int8_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 3926, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_51generator13(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3926, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3930
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int8_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3931
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_int8_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_signed__char(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 3931, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3930
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int8_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3926
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3934
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3936
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef int8_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3939
 *         cdef int8_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3940
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_signed__char(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3939
 *         cdef int8_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3942
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3943
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3942
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3945
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3947
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3948
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_signed__char(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3948, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3947
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3950
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3951
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3951, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 3951, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3950
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3953
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3954
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3954, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 3954, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3953
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3934
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3957
 * 
 * 
 *     def __setitem__(self, key, int8_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_signed__char(__pyx_arg_value); if (unlikely((__pyx_v_value == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3957, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3959
 *     def __setitem__(self, key, int8_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3960
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 3960, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3962
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int8_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3963
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_int8_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3963, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3962
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int8_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3966
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int8_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 3966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 3966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 3966, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3967
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_int8_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_int8_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3967, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":3966
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int8_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3970
 * 
 *             else:
 *                 __insert_node_by_ptr_int8_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int8_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 3970, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3957
 * 
 * 
 *     def __setitem__(self, key, int8_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3976
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int8_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3976, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3976, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3976, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3976, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3976, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3976, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3976, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3978
 *     cpdef __TreeSeries_int8_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_int8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_int8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3976
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int8_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3976, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3976, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3981
 * 
 * 
 *     cpdef __TreeSeries_int8_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3981, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3981, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3981, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3981, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3981, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3983
 *     cpdef __TreeSeries_int8_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_int8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_int8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3983, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3981
 * 
 * 
 *     cpdef __TreeSeries_int8_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3981, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3981, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3986
 * 
 * 
 *     cpdef __TreeSeries_int8_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3986, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3986, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3986, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3986, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3986, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3986, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3986, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3988
 *     cpdef __TreeSeries_int8_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_int8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_int8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3986
 * 
 * 
 *     cpdef __TreeSeries_int8_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3986, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3986, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3991
 * 
 * 
 *     cpdef __TreeSeries_int8_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int8_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3991, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3991, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3991, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3993
 *     cpdef __TreeSeries_int8_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_int8_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_int8_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3991
 * 
 * 
 *     cpdef __TreeSeries_int8_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int8_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 3991, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3991, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3996
 * 
 * 
 *     cpdef __TreeSeries_int8_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3996, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3996, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3996, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 3996, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3996, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 3996, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3998
 *     cpdef __TreeSeries_int8_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3999
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 3999, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":3998
 *     cpdef __TreeSeries_int8_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3996
 * 
 * 
 *     cpdef __TreeSeries_int8_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3996, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4002
 * 
 * 
 *     cpdef __TreeSeries_int8_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4002, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4002, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4002, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4002, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4002, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t))))) __PYX_ERR(3, 4002, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4004
 *     cpdef __TreeSeries_int8_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4005
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 4005, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4004
 *     cpdef __TreeSeries_int8_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4002
 * 
 * 
 *     cpdef __TreeSeries_int8_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4002, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4011
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4015
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4015, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4015, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4016
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 4016, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4015
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4018
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4018, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4018, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 4018, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4018, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 4018, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4018, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 4018, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 4018, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4019
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4019, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4019, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_signed__char(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 4019, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4019, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4018
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4011
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4022
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4024
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4024, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 4024, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4024, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 4024, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4024, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 4024, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4025
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4025, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4024
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4022
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4028
 * 
 * 
 *     cdef int8_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4031
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4034
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4034, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4035
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4037
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4038
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4037
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4041
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4043
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4028
 * 
 * 
 *     cdef int8_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int8_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4048
 * 
 * 
 *     cdef int8_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4050
 *     cdef int8_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4053
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4053, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4054
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4056
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4048
 * 
 * 
 *     cdef int8_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int8_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4061
 * 
 * 
 *     cdef __TreeSeries_int8_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4064
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int8_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4065
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4068
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4068, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4069
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4068, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4067
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4067, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4071
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4071, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4071, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4071, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 4071, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4072
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4071
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4074
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4076
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4076, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4077
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4076
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4079
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4079, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4080
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4079
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4074
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4082
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4083
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4084
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 4084, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4082
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4086
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4087
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4088
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 4088, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4086
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4090
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4091
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4090
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4093
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4090
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4095
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4096
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4095
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4098
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4099
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4100
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4099
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4099, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4098
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4103
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4104
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4105
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4105, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4103
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 4103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4061
 * 
 * 
 *     cdef __TreeSeries_int8_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4108
 * 
 * 
 *     cdef __TreeSeries_int8_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4111
 * 
 *         cdef __TreeSeries_int8_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4113
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4114
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4117
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4117, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4118
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4117, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4116
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4116, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4119
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4120
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 4120, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4119
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4122
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 4122, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 4122, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4122, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4124
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4125
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4125, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_signed__char(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 4125, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4125, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4126
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4126, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4124
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4128
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4129
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4128
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4131
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4131, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 4131, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4132
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4134
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4108
 * 
 * 
 *     cdef __TreeSeries_int8_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4137
 * 
 * 
 *     cdef __TreeSeries_int8_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4140
 * 
 *         cdef __TreeSeries_int8_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4142
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4143
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4146
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4146, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4147
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4146, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4145
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4145, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4148
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4150
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4151
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4151, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 4151, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4150
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4153
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 4153, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 4153, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4153, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4155
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4156
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 4156, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_signed__char(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 4156, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4156, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4157
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4157, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4155
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4159
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4160
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4159
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4162
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4162, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 4162, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4163
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4165
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4148
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4137
 * 
 * 
 *     cdef __TreeSeries_int8_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4168
 * 
 * 
 *     cdef __TreeSeries_int8_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int8_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4176
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4176, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4177
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4176, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4175
 *         cdef object key
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4175, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4178
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4180
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4182
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_int8_t(node), other[key])
 *             __insert_node_int8_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4183
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int8_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int8_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_signed__char(__pyx_t_2); if (unlikely((__pyx_t_6 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 4183, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int8_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4184
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int8_t(node), other[key])
 *             __insert_node_int8_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int8_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4184, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4180
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4186
 *             __insert_node_int8_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4188
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4168
 * 
 * 
 *     cdef __TreeSeries_int8_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int8_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4191
 * 
 * 
 *     cdef __TreeSeries_int8_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int8_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4197
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 4197, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4200
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4200, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4201
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4200, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4199
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_int8_t result
 *         result = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4199, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4203
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4204
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4205
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4206
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4207
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4207, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 4207, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4209
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4210
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4212
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4213
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int8_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4214
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int8_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4214, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4214, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4214, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 4214, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4214, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_signed__char(__pyx_t_3); if (unlikely((__pyx_t_10 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 4214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4214, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_signed__char(__pyx_t_3); if (unlikely((__pyx_t_11 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 4214, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4215
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int8_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int8_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4215, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4216
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int8_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4218
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4219
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4221
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_int16_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4191
 * 
 * 
 *     cdef __TreeSeries_int8_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int8_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":3626
 *     cdef arithmetic_type_int8_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 3626, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3627
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   int8_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 3627, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3628
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   int8_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":3629
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   int8_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_signed__char(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 3629, __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("redblackpy.series.tree_series.__TreeSeries_int8_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_signed__char(__pyx_v_value); if (unlikely((__pyx_t_1 == (signed char)-1) && PyErr_Occurred())) __PYX_ERR(3, 3629, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int8_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4235
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4239
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int16_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 4239, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_short(values[4]); if (unlikely((__pyx_v_extrapolate == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4240, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4239, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 4239, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 4240, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 4240, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4242
 *                    str interpolate="floor", int16_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4243
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4244
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4245
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4247
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4248
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4250
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4252
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4253
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 4253, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4252
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4250
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4256
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4257
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4257, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4256
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4260
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4260, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4239
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int16_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4267
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int16_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4267, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_short(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4267, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4267, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4267, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 4267, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4267, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4269
 *     cpdef void insert(self, key, int16_t value) except*:
 * 
 *         __insert_node_int16_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_int16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4269, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4267
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int16_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int16_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 4267, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 4267, __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_value = __Pyx_PyInt_As_short(values[1]); if (unlikely((__pyx_v_value == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4267, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4267, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4267, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4267, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4272
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4272, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4272, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4272, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4272, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4272, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4272, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4276
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int16_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 4276, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 4276, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4276, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4276, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4277
 * 
 *         for pair in pairs:
 *             __insert_node_int16_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4277, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4277, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_short(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4277, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4277, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4276
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int16_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4272
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 4272, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4272, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4272, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4280
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int16_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4280, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4280, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4280, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4280, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4280, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4280, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4282
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_int16_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_int16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4282, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4280
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int16_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4280, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4280, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4285
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4285, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4285, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4285, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4285, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4285, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4289
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_int16_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 4289, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4289, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4290
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_int16_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4290, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_int16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4290, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4285
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 4285, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4285, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4285, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4293
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4293, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4293, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4293, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4296
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4298
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int16_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4299
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_int16_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4299, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 4299, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4298
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int16_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4301
 *             result.append( __deref_value_ptr_int16_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4293
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4293, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4304
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4304, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4304, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4304, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4307
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4309
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int16_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4310
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int16_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4311
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int16_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4310
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int16_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 4310, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4309
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int16_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4313
 *                              __deref_value_ptr_int16_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4304
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4304, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_18generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":4316
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 4316, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_18generator14, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_int16_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 4316, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_18generator14(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 4316, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4320
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int16_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4321
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int16_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 4321, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4320
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int16_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4316
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4324
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4324, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4324, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4324, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4324, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4324, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4328
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4329
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4329, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4331
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4332
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__78);
    __pyx_r = __pyx_tuple__78;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4331
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4334
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int16_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4335
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_int16_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4334
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int16_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4324
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.floor", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4324, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4338
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4338, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4338, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4338, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4338, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4338, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4338, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4342
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4343
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4343, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4345
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4346
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__79);
    __pyx_r = __pyx_tuple__79;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4345
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4348
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int16_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4349
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_int16_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4348
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int16_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4338
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.ceil", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4338, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4352
 * 
 * 
 *     cpdef __TreeSeries_int16_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4352, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4352, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4352, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4352, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4352, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4360
 *         cdef __TreeSeries_int16_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4361
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4364
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4364, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4365
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4364, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4363
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4363, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4367
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4367, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4368
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4368, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4369
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4370
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4372
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4373
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4372
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4375
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4372
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4377
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4377, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 4377, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4378
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4377
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4380
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int16_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4381
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_int16_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4382
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int16_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4381, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4384
 *                            __deref_value_ptr_int16_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4385
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4384
 *                            __deref_value_ptr_int16_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4387
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4389
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4352
 * 
 * 
 *     cpdef __TreeSeries_int16_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 4352, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 4352, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4352, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4352, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4392
 * 
 * 
 *     cpdef __TreeSeries_int16_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4392, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4392, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4392, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4392, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4392, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4395
 * 
 *         cdef __TreeSeries_int16_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4397
 *         cdef object it = start
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4397, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4398
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4397, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4396
 *         cdef __TreeSeries_int16_t result
 *         cdef object it = start
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4396, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4400
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4402
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4402, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 4402, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4403
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4403, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4403, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4403, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_short(__pyx_t_2); if (unlikely((__pyx_t_8 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4403, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4403, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4404
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4406
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4408
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4392
 * 
 * 
 *     cpdef __TreeSeries_int16_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 4392, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 4392, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 4392, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4392, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4392, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4411
 * 
 * 
 *     cpdef __TreeSeries_int16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__80;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4411, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4411, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4411, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4411, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4418
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4418, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4418, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4419
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4418, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4417
 *         cdef tuple it
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4417, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4421
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 4421, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 4421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4421, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4422
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4422, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4422, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 4422, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 4422, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_short(__pyx_t_3); if (unlikely((__pyx_t_10 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4422, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4422, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4424
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4411
 * 
 * 
 *     cpdef __TreeSeries_int16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__80;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 4411, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4411, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 4411, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 4412, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4411, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4427
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__81;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4427, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4427, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4427, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4432
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4433
 * 
 *         for it in deref(self.__index):
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4434
 *         for it in deref(self.__index):
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 4434, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4433
 * 
 *         for it in deref(self.__index):
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4434
 *         for it in deref(self.__index):
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 4434, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4433
 * 
 *         for it in deref(self.__index):
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_short(__pyx_t_2); if (unlikely((__pyx_t_10 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_int16_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4433, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4432
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int16_t( it, method( __deref_value_ptr_int16_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4427
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__81;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 4427, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4427, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 4427, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 4428, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4427, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4437
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4437, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4437, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4437, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4439
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int16_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4439, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4440
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_int16_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4441
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int16_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4437
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int16_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 4437, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4437, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4444
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4444, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4444, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4444, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4444, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4444, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4446
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 4446, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4447
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4446
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4449
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 4449, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4450
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4449
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4444
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int16_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 4444, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4444, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4453
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4453, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4453, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4453, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4455
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4456
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4453
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int16_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4453, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4459
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4459, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4459, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4461
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4462
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4459
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int16_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4459, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4465
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4465, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4465, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4465, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4465, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4465, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4469
 *         cdef tuple it
 *         cdef int16_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4469, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4471
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 4471, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4473
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <int16_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 4473, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 4473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4473, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4474
 * 
 *             for it in other.iteritems():
 *                 num = <int16_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4474, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 4474, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4475
 *             for it in other.iteritems():
 *                 num = <int16_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4475, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4475, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4471
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4477
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 4477, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4478
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 4478, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 4478, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4478, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4479
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4479, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4479, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_short(__pyx_t_3); if (unlikely((__pyx_t_13 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4479, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4479, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4477
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4482
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 4482, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 4482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4482, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4483
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4483, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4483, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_short(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4483, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4483, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4465
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 4465, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4465, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 4465, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4465, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4465, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4486
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4486, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4486, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4488
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 4488, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 4488, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4489
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4489, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4488
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4491
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4486
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4486, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4486, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4496
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4498
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4496
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4501
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4503
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4504
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4506
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4506, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4508
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 4508, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4508, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4509
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 4509, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 4509, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4509, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4510
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4510, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 4510, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4510, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 4510, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 4510, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4509
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4508
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4513
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4513, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4513, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 4513, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4513, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4513, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4514
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4514, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 4514, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4514, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 4514, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4514, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 4514, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4513
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4516
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4518
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4518, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 4518, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 4518, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4519
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4519, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 4519, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4519, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 4519, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4519, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4518
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4521
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4501
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_int16_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4524
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4526
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4526, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4526, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4526, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4524
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_51generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":4529
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 4529, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_51generator15, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_int16_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 4529, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_51generator15(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 4529, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4533
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int16_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4534
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_int16_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_short(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 4534, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4533
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int16_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4529
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4537
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4539
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef int16_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4542
 *         cdef int16_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4543
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_short(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4542
 *         cdef int16_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4545
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4546
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4545
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4548
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4550
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4551
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_short(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4551, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4550
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4553
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4554
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 4554, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4553
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4556
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4557
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4557, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 4557, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4556
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4537
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4560
 * 
 * 
 *     def __setitem__(self, key, int16_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_short(__pyx_arg_value); if (unlikely((__pyx_v_value == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4560, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4562
 *     def __setitem__(self, key, int16_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4563
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4563, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4565
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int16_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4566
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_int16_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4566, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4565
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int16_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4569
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int16_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4569, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 4569, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4570
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_int16_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_int16_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4570, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4569
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int16_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4573
 * 
 *             else:
 *                 __insert_node_by_ptr_int16_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int16_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4573, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4560
 * 
 * 
 *     def __setitem__(self, key, int16_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4579
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int16_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4579, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4579, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4579, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4579, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4579, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4581
 *     cpdef __TreeSeries_int16_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_int16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_int16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4581, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4579
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int16_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 4579, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4579, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4584
 * 
 * 
 *     cpdef __TreeSeries_int16_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4584, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4584, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4584, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4584, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4584, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4586
 *     cpdef __TreeSeries_int16_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_int16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_int16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4586, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4584
 * 
 * 
 *     cpdef __TreeSeries_int16_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 4584, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4584, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4589
 * 
 * 
 *     cpdef __TreeSeries_int16_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4589, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4589, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4589, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4589, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4589, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4589, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4589, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4591
 *     cpdef __TreeSeries_int16_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_int16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_int16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4589
 * 
 * 
 *     cpdef __TreeSeries_int16_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 4589, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4589, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4594
 * 
 * 
 *     cpdef __TreeSeries_int16_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int16_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4594, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4594, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4594, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4594, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4594, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4596
 *     cpdef __TreeSeries_int16_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_int16_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_int16_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4594
 * 
 * 
 *     cpdef __TreeSeries_int16_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int16_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 4594, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4594, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4599
 * 
 * 
 *     cpdef __TreeSeries_int16_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4599, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4599, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4599, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4601
 *     cpdef __TreeSeries_int16_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4602
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 4602, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4601
 *     cpdef __TreeSeries_int16_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4599
 * 
 * 
 *     cpdef __TreeSeries_int16_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4599, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4605
 * 
 * 
 *     cpdef __TreeSeries_int16_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4605, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4605, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4605, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4605, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4605, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t))))) __PYX_ERR(3, 4605, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4607
 *     cpdef __TreeSeries_int16_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4608
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 4608, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4608, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4607
 *     cpdef __TreeSeries_int16_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4605
 * 
 * 
 *     cpdef __TreeSeries_int16_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4605, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4614
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4618
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4618, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4618, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4619
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 4619, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4618
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4621
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4621, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4621, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 4621, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 4621, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4621, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 4621, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 4621, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4622
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4622, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4622, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_short(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4622, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4622, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4621
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4614
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4625
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4627
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4627, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 4627, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4627, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 4627, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4627, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 4627, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4628
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4628, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4627
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4625
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4631
 * 
 * 
 *     cdef int16_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4634
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4637
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4637, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4638
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4640
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4641
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4640
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4644
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4646
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4631
 * 
 * 
 *     cdef int16_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int16_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4651
 * 
 * 
 *     cdef int16_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4653
 *     cdef int16_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4656
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4656, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4657
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4659
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4651
 * 
 * 
 *     cdef int16_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int16_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4664
 * 
 * 
 *     cdef __TreeSeries_int16_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4667
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int16_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4668
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4671
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4671, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4672
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4671, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4670
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4670, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4674
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4674, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4674, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4674, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 4674, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4675
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4674
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4677
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4677, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4679
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4679, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4680
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4679
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4682
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 4682, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4683
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4682
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4677
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4685
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4685, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4686
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4687
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 4687, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4685
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4689
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4690
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4691
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 4691, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4689
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4693
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4694
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4693
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4696
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4693
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4698
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4699
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4698
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4701
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4702
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4703
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4702
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4702, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4701
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4706
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4707
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4708
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4708, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4706
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 4706, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4664
 * 
 * 
 *     cdef __TreeSeries_int16_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4711
 * 
 * 
 *     cdef __TreeSeries_int16_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4714
 * 
 *         cdef __TreeSeries_int16_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4716
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4717
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4720
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4720, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4720, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4721
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4720, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4719
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4719, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4722
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4723
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 4723, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4722
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4725
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 4725, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 4725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4725, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4727
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4728
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4728, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_short(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4728, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4728, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4729
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4729, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4727
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4731
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4732
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4731
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4734
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4734, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 4734, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4735
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4737
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4711
 * 
 * 
 *     cdef __TreeSeries_int16_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4740
 * 
 * 
 *     cdef __TreeSeries_int16_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4743
 * 
 *         cdef __TreeSeries_int16_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4745
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4746
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4749
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4749, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4749, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4750
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4749, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4748
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4748, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4751
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4751, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4753
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4754
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 4754, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4753
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4756
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 4756, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4756, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 4756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 4756, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4758
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4759
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 4759, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_short(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4759, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4759, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4760
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4760, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4758
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4762
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4763
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":4762
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4765
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 4765, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 4765, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4766
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4768
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4751
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4740
 * 
 * 
 *     cdef __TreeSeries_int16_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4771
 * 
 * 
 *     cdef __TreeSeries_int16_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int16_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4779
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4779, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4780
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4779, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4778
 *         cdef object key
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4778, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4781
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4783
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4785
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_int16_t(node), other[key])
 *             __insert_node_int16_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4786
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int16_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int16_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_short(__pyx_t_2); if (unlikely((__pyx_t_6 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4786, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int16_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4787
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int16_t(node), other[key])
 *             __insert_node_int16_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int16_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4787, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4783
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4789
 *             __insert_node_int16_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4791
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4771
 * 
 * 
 *     cdef __TreeSeries_int16_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int16_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4794
 * 
 * 
 *     cdef __TreeSeries_int16_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int16_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4800
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 4800, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4803
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4803, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4803, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4804
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4803, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4802
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_int16_t result
 *         result = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4802, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4806
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4807
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4808
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4809
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4810
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4810, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 4810, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4812
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4813
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4815
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4816
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int16_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4817
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int16_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4817, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4817, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4817, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 4817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4817, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_short(__pyx_t_3); if (unlikely((__pyx_t_10 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4817, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_short(__pyx_t_3); if (unlikely((__pyx_t_11 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4817, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4818
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int16_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int16_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4818, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4819
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int16_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4821
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4822
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4824
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_int32_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4794
 * 
 * 
 *     cdef __TreeSeries_int16_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int16_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4229
 *     cdef arithmetic_type_int16_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 4229, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4230
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   int16_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 4230, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4231
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   int16_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4232
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   int16_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_short(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4232, __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("redblackpy.series.tree_series.__TreeSeries_int16_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_short(__pyx_v_value); if (unlikely((__pyx_t_1 == (short)-1) && PyErr_Occurred())) __PYX_ERR(3, 4232, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int16_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4838
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4842
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int32_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 4842, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_int(values[4]); if (unlikely((__pyx_v_extrapolate == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4843, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4842, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 4842, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 4843, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 4843, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4845
 *                    str interpolate="floor", int32_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4846
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4847
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4848
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4850
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4851
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4853
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4855
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4856
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4856, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 4856, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4855
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4853
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4859
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4860
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4860, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4859
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4863
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4863, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4842
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int32_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4870
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int32_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4870, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4870, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4870, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 4870, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4870, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4872
 *     cpdef void insert(self, key, int32_t value) except*:
 * 
 *         __insert_node_int32_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_int32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4872, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4870
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int32_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 4870, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 4870, __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_value = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4870, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4870, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4870, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4870, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4875
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4875, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4875, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4875, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4875, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4875, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4875, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4879
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int32_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 4879, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 4879, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4879, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4879, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4880
 * 
 *         for pair in pairs:
 *             __insert_node_int32_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4880, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4880, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4880, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4880, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4879
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int32_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4875
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 4875, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4875, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4875, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4883
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int32_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4883, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4883, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4883, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4883, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4883, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4883, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4885
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_int32_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_int32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4885, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4883
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int32_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4883, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4883, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4888
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4888, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4888, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4888, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4888, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4888, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4892
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_int32_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 4892, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 4892, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4893
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_int32_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 4893, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_int32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4893, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4888
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 4888, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4888, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4888, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4896
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4896, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4896, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4896, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4899
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4899, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4901
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int32_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4902
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_int32_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 4902, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4901
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int32_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4904
 *             result.append( __deref_value_ptr_int32_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4896
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4896, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4907
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4907, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4907, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4907, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4910
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4912
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int32_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4913
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int32_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4914
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int32_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4913
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int32_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 4913, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4912
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int32_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4916
 *                              __deref_value_ptr_int32_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4907
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4907, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_18generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":4919
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 4919, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_18generator16, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_int32_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 4919, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_18generator16(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 4919, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4923
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int32_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4924
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int32_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 4924, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4923
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int32_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4919
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4927
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4927, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4927, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4927, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4927, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4927, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4927, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4931
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4932
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4932, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4934
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4935
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__88);
    __pyx_r = __pyx_tuple__88;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4934
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4937
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int32_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4938
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_int32_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4937
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int32_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4937, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4927
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.floor", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4927, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4941
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4941, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4941, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4941, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4941, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 4941, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4941, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 4941, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4945
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4946
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4946, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4948
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4949
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__89);
    __pyx_r = __pyx_tuple__89;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4948
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4951
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int32_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4952
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_int32_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4951
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int32_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4951, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4941
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.ceil", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4941, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4955
 * 
 * 
 *     cpdef __TreeSeries_int32_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4955, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4955, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4955, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4955, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 4955, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4963
 *         cdef __TreeSeries_int32_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4964
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4967
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 4967, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4968
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 4967, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4966
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4966, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4970
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4970, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4971
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 4971, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4972
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4973
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4975
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4976
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4975
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4978
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4975
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4980
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 4980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4981
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4980
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4983
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int32_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4984
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_int32_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 4984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4985
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int32_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 4984, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4987
 *                            __deref_value_ptr_int32_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4988
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":4987
 *                            __deref_value_ptr_int32_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":4990
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4992
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4955
 * 
 * 
 *     cpdef __TreeSeries_int32_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 4955, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 4955, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4955, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4955, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4995
 * 
 * 
 *     cpdef __TreeSeries_int32_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4995, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4995, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4995, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 4995, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4995, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 4995, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4998
 * 
 *         cdef __TreeSeries_int32_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5000
 *         cdef object it = start
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5000, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5001
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5000, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4999
 *         cdef __TreeSeries_int32_t result
 *         cdef object it = start
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4999, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5003
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5005
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5005, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 5005, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5006
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5006, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5006, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5006, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5006, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5006, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5007
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5009
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5011
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4995
 * 
 * 
 *     cpdef __TreeSeries_int32_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 4995, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 4995, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 4995, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 4995, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4995, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5014
 * 
 * 
 *     cpdef __TreeSeries_int32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__90;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5014, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5014, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5014, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5014, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5014, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5021
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5021, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5021, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5022
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5021, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5020
 *         cdef tuple it
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5020, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5024
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 5024, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 5024, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5024, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5025
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5025, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5025, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 5025, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 5025, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5025, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5025, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5025, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5027
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5014
 * 
 * 
 *     cpdef __TreeSeries_int32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__90;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 5014, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5014, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 5014, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 5015, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5014, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5030
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__91;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5030, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5030, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5030, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5030, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5030, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5035
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5036
 * 
 *         for it in deref(self.__index):
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5037
 *         for it in deref(self.__index):
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 5037, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5036
 * 
 *         for it in deref(self.__index):
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5037
 *         for it in deref(self.__index):
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 5037, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5036
 * 
 *         for it in deref(self.__index):
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5036, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5036, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_int32_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5036, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5035
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int32_t( it, method( __deref_value_ptr_int32_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5030
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__91;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 5030, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5030, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 5030, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 5031, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5030, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5040
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5040, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5040, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5040, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5040, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5040, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5042
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int32_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5043
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_int32_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5044
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int32_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5040
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int32_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 5040, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5040, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5047
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5047, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5047, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5047, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5047, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5047, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5047, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5049
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 5049, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5050
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5049
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5052
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 5052, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5053
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5052
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5047
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int32_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 5047, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5047, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5056
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5056, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5056, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5058
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5059
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5056
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int32_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5056, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5062
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5062, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5062, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5064
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5065
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5062
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int32_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5062, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5068
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5068, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5068, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5068, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5068, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5068, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5072
 *         cdef tuple it
 *         cdef int32_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5072, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5074
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 5074, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5076
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <int32_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5076, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 5076, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5076, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5077
 * 
 *             for it in other.iteritems():
 *                 num = <int32_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5077, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 5077, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5078
 *             for it in other.iteritems():
 *                 num = <int32_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5078, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5078, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5074
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5080
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 5080, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5081
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5081, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 5081, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5081, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5082
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5082, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5082, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5082, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5082, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5082, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5080
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5085
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5085, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 5085, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5085, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5086
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5086, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5086, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5086, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5086, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5068
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 5068, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5068, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 5068, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5068, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5089
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5089, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5089, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5091
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 5091, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 5091, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5092
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5092, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5091
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5094
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5089
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5089, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5089, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5099
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5101
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5099
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":5104
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5106
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5107
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5107, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5109
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5111
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 5111, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5111, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5112
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 5112, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 5112, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5112, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5112, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5113
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5113, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 5113, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5113, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 5113, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5113, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 5113, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5112
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5111
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5116
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5116, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 5116, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5116, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5116, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5117
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5117, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 5117, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5117, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 5117, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5117, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 5117, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5116
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5119
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5121
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5121, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 5121, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5121, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 5121, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5122
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5122, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 5122, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5122, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 5122, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5122, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5122, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5121
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5124
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5104
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_int32_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5127
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5129
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5129, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5129, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5127
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_51generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":5132
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 5132, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_51generator17, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_int32_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 5132, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_51generator17(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 5132, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5136
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int32_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5137
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_int32_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 5137, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5136
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int32_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5132
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5140
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5142
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef int32_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5145
 *         cdef int32_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5146
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5146, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5145
 *         cdef int32_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5148
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5149
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5149, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5148
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5151
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5153
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5154
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5153
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5156
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5157
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 5157, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5156
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5159
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5160
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 5160, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5159
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5140
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5163
 * 
 * 
 *     def __setitem__(self, key, int32_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_int(__pyx_arg_value); if (unlikely((__pyx_v_value == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5163, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5165
 *     def __setitem__(self, key, int32_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5166
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5166, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5168
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int32_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5169
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_int32_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5169, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5168
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int32_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5172
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int32_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5172, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 5172, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5173
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_int32_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_int32_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5173, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5172
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int32_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5176
 * 
 *             else:
 *                 __insert_node_by_ptr_int32_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5176, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5163
 * 
 * 
 *     def __setitem__(self, key, int32_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5182
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int32_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5182, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5182, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5182, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5182, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5182, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5182, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5184
 *     cpdef __TreeSeries_int32_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_int32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_int32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5184, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5182
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int32_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5182, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5182, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5187
 * 
 * 
 *     cpdef __TreeSeries_int32_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5187, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5187, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5187, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5187, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5187, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5189
 *     cpdef __TreeSeries_int32_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_int32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_int32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5189, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5187
 * 
 * 
 *     cpdef __TreeSeries_int32_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5187, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5187, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5192
 * 
 * 
 *     cpdef __TreeSeries_int32_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5192, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5192, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5192, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5192, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5192, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5192, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5194
 *     cpdef __TreeSeries_int32_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_int32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_int32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5192
 * 
 * 
 *     cpdef __TreeSeries_int32_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5192, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5192, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5197
 * 
 * 
 *     cpdef __TreeSeries_int32_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5197, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5197, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5197, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5197, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5197, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5199
 *     cpdef __TreeSeries_int32_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_int32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_int32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5197
 * 
 * 
 *     cpdef __TreeSeries_int32_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5197, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5197, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5202
 * 
 * 
 *     cpdef __TreeSeries_int32_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5202, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5202, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5202, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5202, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5202, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5202, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5204
 *     cpdef __TreeSeries_int32_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5205
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 5205, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5204
 *     cpdef __TreeSeries_int32_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5202
 * 
 * 
 *     cpdef __TreeSeries_int32_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5202, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5208
 * 
 * 
 *     cpdef __TreeSeries_int32_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5208, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5208, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5208, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5208, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t))))) __PYX_ERR(3, 5208, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5210
 *     cpdef __TreeSeries_int32_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5211
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 5211, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5210
 *     cpdef __TreeSeries_int32_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5208
 * 
 * 
 *     cpdef __TreeSeries_int32_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5208, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5217
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5221
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5221, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5221, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5222
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 5222, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5221
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5224
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5224, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5224, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5224, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 5224, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 5224, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5224, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 5224, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 5224, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5225
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5225, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5225, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5225, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5225, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5224
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5217
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5228
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5230
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5230, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 5230, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5230, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 5230, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5230, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 5230, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5231
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5231, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5230
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5228
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5234
 * 
 * 
 *     cdef int32_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5237
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5240
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5240, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5241
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5243
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5244
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5243
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5247
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5249
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5234
 * 
 * 
 *     cdef int32_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int32_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5254
 * 
 * 
 *     cdef int32_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5256
 *     cdef int32_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5259
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5259, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5260
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5262
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5254
 * 
 * 
 *     cdef int32_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int32_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5267
 * 
 * 
 *     cdef __TreeSeries_int32_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5270
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int32_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5271
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5274
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5274, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5275
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5274, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5273
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5273, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5277
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5277, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5277, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 5277, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5278
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5277
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5280
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5282
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5282, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5283
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5282
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5285
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5285, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5286
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5285
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5280
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5288
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5289
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5290
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 5290, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5288
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5292
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5293
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5293, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5294
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 5294, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5292
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5296
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5297
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5296
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5299
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5296
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5301
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5302
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5301
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5304
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5304, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5305
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5306
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5305
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5305, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5304
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5309
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5310
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5311
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5309
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 5309, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5267
 * 
 * 
 *     cdef __TreeSeries_int32_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5314
 * 
 * 
 *     cdef __TreeSeries_int32_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5317
 * 
 *         cdef __TreeSeries_int32_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5319
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5320
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5323
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5323, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5324
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5323, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5322
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5322, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5325
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5326
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 5326, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5325
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5328
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 5328, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 5328, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5328, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5330
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5331
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5331, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_int(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5331, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5331, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5332
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5332, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5330
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5334
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5335
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5334
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5337
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5337, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 5337, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5338
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5340
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5314
 * 
 * 
 *     cdef __TreeSeries_int32_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5343
 * 
 * 
 *     cdef __TreeSeries_int32_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5346
 * 
 *         cdef __TreeSeries_int32_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5348
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5349
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5352
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5352, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5353
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5352, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5351
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5351, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5354
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5356
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5357
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5357, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 5357, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5356
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5359
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5359, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5359, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 5359, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5359, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5361
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5362
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 5362, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_int(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5362, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5362, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5363
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5363, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5361
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5365
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5366
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5365
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5368
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5368, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 5368, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5369
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5371
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5354
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5343
 * 
 * 
 *     cdef __TreeSeries_int32_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5374
 * 
 * 
 *     cdef __TreeSeries_int32_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int32_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5382
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5382, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5383
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5382, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5381
 *         cdef object key
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5381, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5384
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5386
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5388
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_int32_t(node), other[key])
 *             __insert_node_int32_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5389
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int32_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int32_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5389, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5389, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int32_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5390
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int32_t(node), other[key])
 *             __insert_node_int32_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int32_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5390, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5386
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5392
 *             __insert_node_int32_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5394
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5374
 * 
 * 
 *     cdef __TreeSeries_int32_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int32_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5397
 * 
 * 
 *     cdef __TreeSeries_int32_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int32_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5403
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 5403, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5406
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5406, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5406, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5407
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5406, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5405
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_int32_t result
 *         result = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5405, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5409
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5410
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5411
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5412
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5413
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5413, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 5413, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5415
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5416
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5418
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5419
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int32_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5420
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int32_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5420, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5420, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5420, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 5420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5420, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5420, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5420, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_11 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 5420, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5421
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int32_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int32_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5421, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5422
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int32_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5424
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5425
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5427
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_int64_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5397
 * 
 * 
 *     cdef __TreeSeries_int32_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int32_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":4832
 *     cdef arithmetic_type_int32_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 4832, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4833
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   int32_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 4833, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4834
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   int32_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":4835
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   int32_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 4835, __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("redblackpy.series.tree_series.__TreeSeries_int32_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 4835, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int32_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5441
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":5445
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int64_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 5445, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_PY_LONG_LONG(values[4]); if (unlikely((__pyx_v_extrapolate == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5446, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5445, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 5445, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 5446, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 5446, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5448
 *                    str interpolate="floor", int64_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5449
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5450
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5451
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5453
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5454
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5456
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5458
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5459
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5459, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 5459, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5458
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5456
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5462
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5463
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5463, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5462
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5466
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5466, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5445
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int64_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5473
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int64_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5473, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5473, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 5473, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5473, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5475
 *     cpdef void insert(self, key, int64_t value) except*:
 * 
 *         __insert_node_int64_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_int64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5475, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5473
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int64_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 5473, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 5473, __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_value = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_value == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5473, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5473, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5473, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5473, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5478
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5478, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5478, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5478, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5478, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5478, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5478, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5482
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int64_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 5482, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 5482, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5482, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5482, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5483
 * 
 *         for pair in pairs:
 *             __insert_node_int64_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5483, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5483, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5483, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5483, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5482
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int64_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5478
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 5478, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5478, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5478, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5486
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int64_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5486, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5486, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5486, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5486, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5486, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5488
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_int64_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_int64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5488, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5486
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int64_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5486, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5486, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5491
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5491, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5491, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5491, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5491, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5495
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_int64_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 5495, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5495, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5496
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_int64_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5496, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_int64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5496, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5491
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 5491, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5491, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5491, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5499
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5499, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5499, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5499, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5502
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5504
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int64_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5505
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_int64_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5505, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 5505, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5504
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int64_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5507
 *             result.append( __deref_value_ptr_int64_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5499
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5499, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5510
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5510, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5510, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5510, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5513
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5515
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int64_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5516
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int64_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5517
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int64_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5516
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int64_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 5516, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5515
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int64_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5519
 *                              __deref_value_ptr_int64_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5510
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5510, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_18generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":5522
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 5522, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_18generator18, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_int64_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 5522, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_18generator18(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 5522, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5526
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int64_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5527
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int64_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 5527, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5526
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int64_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5522
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5530
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5530, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5530, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5530, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5530, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5530, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5534
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5535
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5535, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5537
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5538
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__98);
    __pyx_r = __pyx_tuple__98;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5537
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5540
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int64_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5541
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_int64_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5540
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int64_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5530
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.floor", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5530, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5544
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5544, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5544, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5544, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5544, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5544, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5544, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5544, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5548
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5549
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5549, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5551
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5552
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__99);
    __pyx_r = __pyx_tuple__99;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5551
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5554
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int64_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5555
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_int64_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5554
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int64_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5544
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.ceil", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5544, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5558
 * 
 * 
 *     cpdef __TreeSeries_int64_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5558, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5558, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5558, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5558, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5566
 *         cdef __TreeSeries_int64_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5567
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5570
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5570, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5571
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5570, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5569
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5569, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5573
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5573, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5574
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5574, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5575
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5576
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5578
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5579
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5578
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5581
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5578
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5583
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 5583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5584
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5583
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5586
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int64_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5587
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_int64_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5588
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int64_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5587, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5590
 *                            __deref_value_ptr_int64_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5591
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5590
 *                            __deref_value_ptr_int64_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5593
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5595
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5558
 * 
 * 
 *     cpdef __TreeSeries_int64_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 5558, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 5558, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5558, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5558, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5598
 * 
 * 
 *     cpdef __TreeSeries_int64_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5598, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5598, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5598, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5598, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5601
 * 
 *         cdef __TreeSeries_int64_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5603
 *         cdef object it = start
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5603, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5604
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5603, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5602
 *         cdef __TreeSeries_int64_t result
 *         cdef object it = start
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5602, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5606
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5608
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5608, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 5608, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5609
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5609, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5609, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5609, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5609, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5609, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5610
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5612
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5614
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5598
 * 
 * 
 *     cpdef __TreeSeries_int64_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 5598, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 5598, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 5598, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5598, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5598, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5617
 * 
 * 
 *     cpdef __TreeSeries_int64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__100;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5617, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5617, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5617, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5617, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5624
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5624, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5624, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5625
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5624, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5623
 *         cdef tuple it
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5623, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5627
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 5627, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 5627, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5627, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5628
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5628, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5628, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 5628, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 5628, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5628, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5628, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5628, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5630
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5617
 * 
 * 
 *     cpdef __TreeSeries_int64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__100;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 5617, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5617, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 5617, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 5618, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5617, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5633
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__101;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5633, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5633, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5633, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5633, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5633, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5638
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5639
 * 
 *         for it in deref(self.__index):
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5640
 *         for it in deref(self.__index):
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 5640, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5639
 * 
 *         for it in deref(self.__index):
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5640
 *         for it in deref(self.__index):
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 5640, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5639
 * 
 *         for it in deref(self.__index):
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5639, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5639, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_int64_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5639, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5638
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int64_t( it, method( __deref_value_ptr_int64_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5633
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__101;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 5633, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5633, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 5633, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 5634, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5633, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5643
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5643, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5643, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5643, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5643, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5645
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int64_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5645, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5645, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5646
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_int64_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5647
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int64_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5643
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int64_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 5643, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5643, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5650
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5650, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5650, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5650, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5650, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5650, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5650, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5652
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 5652, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5653
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5652
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5655
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 5655, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5656
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5655
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5650
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int64_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 5650, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5650, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5659
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5659, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5659, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5661
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5662
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5659
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int64_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5659, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5665
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5665, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5665, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5667
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5668
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5665
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int64_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5665, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5671
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5671, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5671, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5671, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5671, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5675
 *         cdef tuple it
 *         cdef int64_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5675, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5677
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 5677, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5679
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <int64_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5679, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 5679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5679, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5680
 * 
 *             for it in other.iteritems():
 *                 num = <int64_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5680, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 5680, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5681
 *             for it in other.iteritems():
 *                 num = <int64_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5681, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5681, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5677
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5683
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 5683, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5684
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5684, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 5684, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5684, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5685
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5685, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5685, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5685, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5685, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5685, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5683
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5688
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5688, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 5688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5688, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5689
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5689, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5689, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5689, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5689, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5671
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 5671, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 5671, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 5671, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5671, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5671, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5692
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5692, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5692, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5694
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5694, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 5694, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 5694, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5695
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5695, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5694
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5697
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5692
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5692, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5692, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5702
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5704
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5702
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":5707
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5709
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5710
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5712
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5712, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5714
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 5714, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5714, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5715
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 5715, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 5715, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5715, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5715, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5716
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5716, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 5716, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5716, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 5716, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5716, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 5716, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5715
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5714
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5719
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5719, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5719, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 5719, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5719, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 5719, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5720
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5720, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 5720, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5720, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 5720, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 5720, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5719
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5722
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5724
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5724, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5724, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 5724, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5724, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 5724, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5725
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5725, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 5725, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5725, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 5725, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5725, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5724
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5727
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5707
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_int64_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5730
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5732
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5732, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5732, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5732, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5730
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_51generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":5735
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 5735, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_51generator19, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_int64_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 5735, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_51generator19(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 5735, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5739
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int64_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5740
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_int64_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 5740, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5739
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int64_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5735
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5743
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5745
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef int64_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5748
 *         cdef int64_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5749
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5749, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5748
 *         cdef int64_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5751
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5752
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5752, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5751
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5754
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5756
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5757
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5757, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5756
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5759
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5760
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5760, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 5760, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5759
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5762
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5763
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5763, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 5763, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5762
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5743
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5766
 * 
 * 
 *     def __setitem__(self, key, int64_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_arg_value); if (unlikely((__pyx_v_value == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5766, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5768
 *     def __setitem__(self, key, int64_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5769
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5769, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5771
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int64_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5772
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_int64_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5772, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5771
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int64_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5775
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int64_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5775, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 5775, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5776
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_int64_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_int64_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5776, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5775
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int64_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5779
 * 
 *             else:
 *                 __insert_node_by_ptr_int64_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5779, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5766
 * 
 * 
 *     def __setitem__(self, key, int64_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5785
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int64_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5785, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5785, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5785, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5785, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5785, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5785, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5787
 *     cpdef __TreeSeries_int64_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_int64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_int64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5785
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int64_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5785, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5785, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5790
 * 
 * 
 *     cpdef __TreeSeries_int64_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5790, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5790, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5790, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5790, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5790, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5792
 *     cpdef __TreeSeries_int64_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_int64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_int64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5792, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5790
 * 
 * 
 *     cpdef __TreeSeries_int64_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5790, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5790, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5795
 * 
 * 
 *     cpdef __TreeSeries_int64_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5795, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5795, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5795, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5795, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5795, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5797
 *     cpdef __TreeSeries_int64_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_int64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_int64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5795
 * 
 * 
 *     cpdef __TreeSeries_int64_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5795, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5795, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5800
 * 
 * 
 *     cpdef __TreeSeries_int64_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5800, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5800, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5800, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5800, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5802
 *     cpdef __TreeSeries_int64_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_int64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_int64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5800
 * 
 * 
 *     cpdef __TreeSeries_int64_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 5800, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5800, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5805
 * 
 * 
 *     cpdef __TreeSeries_int64_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5805, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5805, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5805, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5807
 *     cpdef __TreeSeries_int64_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5808
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 5808, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5807
 *     cpdef __TreeSeries_int64_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5805
 * 
 * 
 *     cpdef __TreeSeries_int64_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5805, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5811
 * 
 * 
 *     cpdef __TreeSeries_int64_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5811, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5811, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5811, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5811, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5811, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t))))) __PYX_ERR(3, 5811, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5813
 *     cpdef __TreeSeries_int64_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5814
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 5814, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5814, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5813
 *     cpdef __TreeSeries_int64_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5811
 * 
 * 
 *     cpdef __TreeSeries_int64_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5811, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5820
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5824
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5824, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 5824, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5825
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 5825, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5824
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5827
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 5827, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 5827, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5827, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 5827, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 5827, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 5827, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 5827, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5828
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5828, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5828, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5828, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5828, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5827
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5820
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5831
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5833
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5833, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 5833, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 5833, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 5833, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 5833, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5834
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5834, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5833
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5831
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5837
 * 
 * 
 *     cdef int64_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5840
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5843
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5843, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5844
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5846
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5847
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5846
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5850
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5852
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5837
 * 
 * 
 *     cdef int64_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int64_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5857
 * 
 * 
 *     cdef int64_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5859
 *     cdef int64_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5862
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 5862, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5863
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5865
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5857
 * 
 * 
 *     cdef int64_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int64_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5870
 * 
 * 
 *     cdef __TreeSeries_int64_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5873
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int64_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5874
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5877
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5877, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5878
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5877, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5876
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5876, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5880
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5880, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5880, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 5880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5881
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5880
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5883
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5885
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5885, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5886
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5885
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5888
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 5888, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5889
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5888
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5883
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5891
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5892
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5893
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 5893, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5891
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5895
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5896
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5896, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5897
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 5897, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5895
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5899
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5900
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5899
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5902
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5899
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5904
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5905
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5904
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5907
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5908
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5909
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5908
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5908, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5907
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5912
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 5912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5913
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5914
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5914, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5912
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 5912, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5870
 * 
 * 
 *     cdef __TreeSeries_int64_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5917
 * 
 * 
 *     cdef __TreeSeries_int64_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5920
 * 
 *         cdef __TreeSeries_int64_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5922
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5923
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5926
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5926, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5926, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5927
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5926, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5925
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5925, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5928
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5929
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 5929, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5928
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5931
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 5931, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 5931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5931, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5933
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5934
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5934, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5934, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5934, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5935
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5935, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5933
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5937
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5938
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5937
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5940
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 5940, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 5940, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5941
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5943
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5917
 * 
 * 
 *     cdef __TreeSeries_int64_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5946
 * 
 * 
 *     cdef __TreeSeries_int64_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5949
 * 
 *         cdef __TreeSeries_int64_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5951
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5952
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5955
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5955, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5956
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5955, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5954
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5954, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5957
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5957, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5959
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5960
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5960, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 5960, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5959
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5962
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 5962, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5962, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 5962, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 5962, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5964
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5965
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 5965, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_PY_LONG_LONG(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5965, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5965, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5966
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5966, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5964
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5968
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5969
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":5968
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5971
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 5971, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 5971, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":5972
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5974
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5957
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5946
 * 
 * 
 *     cdef __TreeSeries_int64_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5977
 * 
 * 
 *     cdef __TreeSeries_int64_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int64_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5985
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 5985, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5986
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 5985, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5984
 *         cdef object key
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5984, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5987
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5989
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5991
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_int64_t(node), other[key])
 *             __insert_node_int64_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5992
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int64_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int64_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5992, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5992, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int64_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5993
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int64_t(node), other[key])
 *             __insert_node_int64_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int64_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 5993, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":5989
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5995
 *             __insert_node_int64_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5997
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5977
 * 
 * 
 *     cdef __TreeSeries_int64_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int64_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6000
 * 
 * 
 *     cdef __TreeSeries_int64_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int64_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6006
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 6006, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6009
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6009, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6009, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6010
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6009, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6008
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_int64_t result
 *         result = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6008, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6012
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6013
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6014
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6015
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6016
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6016, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 6016, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6018
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6019
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6021
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6022
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int64_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6023
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int64_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6023, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6023, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6023, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 6023, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6023, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6023, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6023, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_11 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6023, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6024
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int64_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int64_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6024, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6025
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int64_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6027
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6028
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6030
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_int96_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6000
 * 
 * 
 *     cdef __TreeSeries_int64_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int64_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":5435
 *     cdef arithmetic_type_int64_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 5435, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":5436
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   int64_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 5436, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":5437
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   int64_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":5438
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   int64_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 5438, __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("redblackpy.series.tree_series.__TreeSeries_int64_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 5438, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int64_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6044
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6048
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int96_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 6048, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_PY_LONG_LONG(values[4]); if (unlikely((__pyx_v_extrapolate == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6049, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6048, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 6048, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 6049, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 6049, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6051
 *                    str interpolate="floor", int96_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6052
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6053
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6054
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6056
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6057
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6059
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6061
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6062
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6062, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 6062, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6061
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6059
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6065
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6066
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6066, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6065
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6069
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6069, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6048
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int96_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6076
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int96_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6076, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6076, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6076, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 6076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6076, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6078
 *     cpdef void insert(self, key, int96_t value) except*:
 * 
 *         __insert_node_int96_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_int96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6078, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6076
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int96_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 6076, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 6076, __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_value = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_value == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6076, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6076, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6076, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6076, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6081
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6081, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6081, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6081, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6081, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6081, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6081, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6085
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int96_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 6085, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 6085, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6085, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6085, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6086
 * 
 *         for pair in pairs:
 *             __insert_node_int96_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6086, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6086, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6086, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6086, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6085
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int96_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6081
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 6081, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6081, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6081, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6089
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int96_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6089, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6089, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6089, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6089, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6089, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6089, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6091
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_int96_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_int96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6091, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6089
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int96_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6089, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6089, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6094
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6094, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6094, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6094, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6094, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6094, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6098
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_int96_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 6098, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 6098, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6099
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_int96_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6099, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_int96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6099, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6094
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 6094, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6094, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6094, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6102
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6102, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6102, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6102, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6105
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6107
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int96_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6108
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_int96_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6108, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 6108, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6107
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int96_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6110
 *             result.append( __deref_value_ptr_int96_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6102
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6102, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6113
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6113, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6113, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6113, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6116
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6118
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int96_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6119
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int96_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6120
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int96_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6119
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int96_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 6119, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6118
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int96_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6122
 *                              __deref_value_ptr_int96_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6113
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6113, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_18generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":6125
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 6125, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_18generator20, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_int96_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 6125, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_18generator20(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6125, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6129
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int96_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6130
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int96_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6130, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6129
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int96_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6125
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6133
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6133, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6133, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6133, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6133, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6133, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6133, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6137
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6138
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6138, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6140
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6141
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__108);
    __pyx_r = __pyx_tuple__108;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6140
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6143
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int96_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6144
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_int96_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6143
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int96_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6143, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6133
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.floor", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6133, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6147
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6147, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6147, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6147, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6147, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6147, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6147, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6147, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6151
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6152
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6152, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6154
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6155
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__109);
    __pyx_r = __pyx_tuple__109;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6154
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6157
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int96_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6158
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_int96_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6157
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int96_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6157, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6147
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.ceil", __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_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6147, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6161
 * 
 * 
 *     cpdef __TreeSeries_int96_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6161, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6161, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6161, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6161, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6169
 *         cdef __TreeSeries_int96_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6170
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6173
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6173, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6174
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6173, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6172
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6172, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6176
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6176, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6177
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6177, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6178
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6179
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6181
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6182
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6181
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6184
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6181
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6186
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6186, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 6186, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6187
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6186
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6189
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int96_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6190
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_int96_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6191
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int96_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6190, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6193
 *                            __deref_value_ptr_int96_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6194
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6193
 *                            __deref_value_ptr_int96_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6196
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6198
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6161
 * 
 * 
 *     cpdef __TreeSeries_int96_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 6161, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 6161, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6161, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6161, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6201
 * 
 * 
 *     cpdef __TreeSeries_int96_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6201, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6201, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6201, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6201, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6201, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6201, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6204
 * 
 *         cdef __TreeSeries_int96_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6206
 *         cdef object it = start
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6206, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6207
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6206, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6205
 *         cdef __TreeSeries_int96_t result
 *         cdef object it = start
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6205, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6209
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6211
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6211, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 6211, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6212
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6212, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6212, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6212, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6212, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6212, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6213
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6215
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6217
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6201
 * 
 * 
 *     cpdef __TreeSeries_int96_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 6201, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 6201, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 6201, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6201, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6201, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6220
 * 
 * 
 *     cpdef __TreeSeries_int96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__110;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6220, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6220, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6220, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6227
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6227, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6227, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6228
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6227, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6226
 *         cdef tuple it
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6226, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6230
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 6230, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 6230, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6230, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6231
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6231, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6231, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 6231, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 6231, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6231, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6233
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6220
 * 
 * 
 *     cpdef __TreeSeries_int96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__110;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 6220, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6220, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 6220, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 6221, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6220, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6236
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__111;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6236, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6236, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6236, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6241
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6242
 * 
 *         for it in deref(self.__index):
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6243
 *         for it in deref(self.__index):
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 6243, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6242
 * 
 *         for it in deref(self.__index):
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6243
 *         for it in deref(self.__index):
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 6243, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6242
 * 
 *         for it in deref(self.__index):
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6242, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6242, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_int96_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6242, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6241
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int96_t( it, method( __deref_value_ptr_int96_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6236
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__111;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 6236, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6236, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 6236, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 6237, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6236, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6246
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6246, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6246, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6246, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6246, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6248
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int96_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6249
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_int96_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6250
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int96_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6246
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int96_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 6246, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6246, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6253
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6253, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6253, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6253, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6253, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6253, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6255
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 6255, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6256
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6255
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6258
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 6258, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6259
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6258
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6253
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int96_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 6253, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6253, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6262
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6262, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6262, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6264
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6265
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6262
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int96_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6262, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6268
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6268, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6268, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6270
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6271
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6268
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int96_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6268, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6274
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6274, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6274, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6274, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6274, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6278
 *         cdef tuple it
 *         cdef int96_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6278, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6280
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 6280, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6282
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <int96_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6282, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 6282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6282, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6283
 * 
 *             for it in other.iteritems():
 *                 num = <int96_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6283, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 6283, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6284
 *             for it in other.iteritems():
 *                 num = <int96_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6284, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6284, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6280
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6286
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 6286, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6287
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6287, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 6287, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6287, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6288
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6288, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6288, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6288, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6286
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6291
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6291, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 6291, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6291, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6292
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6292, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6292, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6292, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6292, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6274
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 6274, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6274, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 6274, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6274, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6274, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6295
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6295, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6295, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6297
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 6297, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 6297, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6298
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6298, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6297
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6300
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6295
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6295, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6295, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6305
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6307
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6305
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6310
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6312
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6313
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6313, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6315
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6317
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 6317, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 6317, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6318
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 6318, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 6318, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6318, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6318, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6319
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6319, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 6319, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6319, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 6319, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6319, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 6319, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6318
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6317
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6322
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6322, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6322, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 6322, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6322, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6322, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6323
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6323, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 6323, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6323, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 6323, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6323, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 6323, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6322
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6325
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6327
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6327, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6327, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 6327, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6327, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 6327, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6328
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6328, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 6328, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6328, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 6328, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6328, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6328, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6327
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6330
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6310
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_int96_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6333
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6335
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6335, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6335, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6333
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_51generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":6338
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 6338, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_51generator21, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_int96_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 6338, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_51generator21(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6338, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6342
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int96_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6343
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_int96_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6343, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6342
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int96_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6338
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6346
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6348
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef int96_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6351
 *         cdef int96_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6352
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6351
 *         cdef int96_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6354
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6355
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6355, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6354
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6357
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6359
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6360
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6359
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6362
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6363
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6363, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 6363, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6362
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6365
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6366
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6366, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 6366, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6365
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6346
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6369
 * 
 * 
 *     def __setitem__(self, key, int96_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_arg_value); if (unlikely((__pyx_v_value == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6369, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6371
 *     def __setitem__(self, key, int96_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6372
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6372, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6374
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int96_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6375
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_int96_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6375, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6374
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int96_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6378
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int96_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6378, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 6378, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6379
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_int96_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_int96_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6379, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6378
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int96_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6382
 * 
 *             else:
 *                 __insert_node_by_ptr_int96_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6382, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6369
 * 
 * 
 *     def __setitem__(self, key, int96_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6388
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int96_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6388, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6388, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6388, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6388, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6388, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6388, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6388, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6390
 *     cpdef __TreeSeries_int96_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_int96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_int96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6390, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6388
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int96_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 6388, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6388, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6393
 * 
 * 
 *     cpdef __TreeSeries_int96_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6393, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6393, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6393, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6393, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6393, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6393, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6395
 *     cpdef __TreeSeries_int96_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_int96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_int96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6393
 * 
 * 
 *     cpdef __TreeSeries_int96_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 6393, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6393, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6398
 * 
 * 
 *     cpdef __TreeSeries_int96_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6398, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6398, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6398, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6398, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6398, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6398, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6400
 *     cpdef __TreeSeries_int96_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_int96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_int96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6400, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6398
 * 
 * 
 *     cpdef __TreeSeries_int96_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 6398, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6398, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6403
 * 
 * 
 *     cpdef __TreeSeries_int96_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6403, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6403, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6403, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6403, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6403, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6405
 *     cpdef __TreeSeries_int96_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_int96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_int96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6403
 * 
 * 
 *     cpdef __TreeSeries_int96_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 6403, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6403, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6408
 * 
 * 
 *     cpdef __TreeSeries_int96_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6408, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6408, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6408, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6410
 *     cpdef __TreeSeries_int96_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6411
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 6411, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6410
 *     cpdef __TreeSeries_int96_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6408
 * 
 * 
 *     cpdef __TreeSeries_int96_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6408, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6414
 * 
 * 
 *     cpdef __TreeSeries_int96_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6414, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6414, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6414, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6414, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6414, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6414, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t))))) __PYX_ERR(3, 6414, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6416
 *     cpdef __TreeSeries_int96_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6417
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 6417, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6417, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6416
 *     cpdef __TreeSeries_int96_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6414
 * 
 * 
 *     cpdef __TreeSeries_int96_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6414, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6423
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6427
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 6427, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 6427, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6428
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 6428, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6427
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6430
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6430, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 6430, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 6430, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6430, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 6430, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 6430, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6431
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6431, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6431, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6431, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6431, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6430
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6423
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6434
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6436
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6436, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 6436, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 6436, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6436, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 6436, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6437
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6437, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6436
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6434
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6440
 * 
 * 
 *     cdef int96_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6443
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6446
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6446, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6447
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6449
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6450
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6449
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6453
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6455
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6440
 * 
 * 
 *     cdef int96_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int96_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6460
 * 
 * 
 *     cdef int96_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6462
 *     cdef int96_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6465
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6465, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6466
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6468
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6460
 * 
 * 
 *     cdef int96_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int96_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6473
 * 
 * 
 *     cdef __TreeSeries_int96_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6476
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int96_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6477
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6480
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6480, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6481
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6480, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6479
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6479, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6483
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6483, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6483, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6483, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 6483, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6484
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6483
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6486
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6486, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6488
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 6488, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6489
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6488
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6491
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 6491, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6492
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6491
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6486
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6494
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6495
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6496
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 6496, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6494
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6498
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6499
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6499, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6500
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 6500, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6498
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6502
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6503
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6502
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6505
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6502
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6507
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6508
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6507
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6510
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6511
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6512
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6511
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6511, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6510
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6515
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6516
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6517
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6517, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6515
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 6515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6473
 * 
 * 
 *     cdef __TreeSeries_int96_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6520
 * 
 * 
 *     cdef __TreeSeries_int96_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6523
 * 
 *         cdef __TreeSeries_int96_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6525
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6526
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6529
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6529, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6529, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6530
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6529, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6528
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6528, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6531
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6532
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 6532, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6531
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6534
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 6534, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 6534, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6534, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6536
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6537
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6537, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6537, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6537, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6538
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6538, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6536
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6540
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6541
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6540
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6543
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6543, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 6543, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6544
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6546
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6520
 * 
 * 
 *     cdef __TreeSeries_int96_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6549
 * 
 * 
 *     cdef __TreeSeries_int96_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6552
 * 
 *         cdef __TreeSeries_int96_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6554
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6555
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6558
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6558, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6559
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6558, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6557
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6557, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6560
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6562
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6563
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 6563, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6562
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6565
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6565, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6565, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 6565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6565, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6567
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":6568
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 6568, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_PY_LONG_LONG(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6568, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6568, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":6569
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6569, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":6567
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6571
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":6572
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":6571
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6574
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6574, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 6574, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6575
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6577
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6560
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6549
 * 
 * 
 *     cdef __TreeSeries_int96_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6580
 * 
 * 
 *     cdef __TreeSeries_int96_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int96_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6588
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6588, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6589
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6588, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6587
 *         cdef object key
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6587, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6590
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6592
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6594
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_int96_t(node), other[key])
 *             __insert_node_int96_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6595
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int96_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int96_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6595, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6595, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int96_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6596
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int96_t(node), other[key])
 *             __insert_node_int96_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int96_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6596, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6592
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6598
 *             __insert_node_int96_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6600
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6580
 * 
 * 
 *     cdef __TreeSeries_int96_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int96_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6603
 * 
 * 
 *     cdef __TreeSeries_int96_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int96_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6609
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 6609, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6612
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6612, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6613
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6612, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6611
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_int96_t result
 *         result = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6611, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6615
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6616
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6617
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6618
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6619
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6619, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 6619, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6621
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6622
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6624
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6625
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int96_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6626
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int96_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6626, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6626, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 6626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6626, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6626, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_11 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6626, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6627
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int96_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int96_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6627, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6628
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int96_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6630
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6631
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6633
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_int128_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6603
 * 
 * 
 *     cdef __TreeSeries_int96_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int96_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6038
 *     cdef arithmetic_type_int96_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 6038, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6039
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   int96_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

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

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 6039, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6040
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   int96_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6041
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   int96_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6041, __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("redblackpy.series.tree_series.__TreeSeries_int96_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6041, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int96_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6647
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6651
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int128_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 6651, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __Pyx_PyInt_As_PY_LONG_LONG(values[4]); if (unlikely((__pyx_v_extrapolate == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6652, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6651, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 6651, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 6652, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 6652, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6654
 *                    str interpolate="floor", int128_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6655
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6656
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6657
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6659
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6660
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6662
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6664
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6665
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6665, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 6665, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6664
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6662
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6668
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6669
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6669, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6668
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6672
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6672, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6651
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", int128_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6679
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int128_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_5insert)) {
      __pyx_t_3 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6679, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6679, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6679, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 6679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6681
 *     cpdef void insert(self, key, int128_t value) except*:
 * 
 *         __insert_node_int128_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_int128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6681, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6679
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, int128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_int128_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 6679, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 6679, __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_value = __Pyx_PyInt_As_PY_LONG_LONG(values[1]); if (unlikely((__pyx_v_value == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6679, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6679, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6679, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6679, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6684
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6684, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6684, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6684, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6684, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6684, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6684, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6688
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int128_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 6688, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 6688, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6688, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6688, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6689
 * 
 *         for pair in pairs:
 *             __insert_node_int128_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6689, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6689, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6689, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6689, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6688
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_int128_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6684
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 6684, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6684, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6684, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6692
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int128_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6692, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6692, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6692, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6692, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6694
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_int128_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_int128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6694, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6692
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_int128_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6692, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6692, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6697
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6697, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6697, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6697, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6697, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6697, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6701
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_int128_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 6701, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 6701, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6702
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_int128_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6702, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_int128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6702, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6697
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 6697, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6697, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6697, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6705
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6705, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6705, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6705, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6708
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6710
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int128_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6711
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_int128_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6711, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 6711, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6710
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_int128_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6713
 *             result.append( __deref_value_ptr_int128_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6705
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6705, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6716
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6716, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6716, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6716, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6719
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6721
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int128_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6722
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int128_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6723
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int128_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6722
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_int128_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 6722, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6721
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_int128_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6725
 *                              __deref_value_ptr_int128_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6716
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6716, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_18generator22(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":6728
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 6728, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_18generator22, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_int128_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 6728, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_18generator22(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6728, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6732
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int128_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6733
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int128_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6733, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6732
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_int128_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6728
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6736
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6736, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6736, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6736, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6736, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6736, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6736, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6740
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6741
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6741, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6743
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6744
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__118);
    __pyx_r = __pyx_tuple__118;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6743
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6746
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int128_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6747
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_int128_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6746
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int128_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6746, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6736
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.floor", __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_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6736, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6750
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6750, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6750, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6750, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6750, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6750, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6754
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6755
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6755, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6757
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6758
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__119);
    __pyx_r = __pyx_tuple__119;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6757
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6760
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int128_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6761
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_int128_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6760
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_int128_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6760, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6750
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.ceil", __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_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6750, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6764
 * 
 * 
 *     cpdef __TreeSeries_int128_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6764, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6764, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6764, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 6764, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6772
 *         cdef __TreeSeries_int128_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6773
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6776
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6776, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6777
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6776, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6775
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6775, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6779
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6779, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6780
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6780, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6781
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6782
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6784
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6785
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6784
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6787
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6784
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6789
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6789, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 6789, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6790
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6789
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6792
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int128_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6793
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_int128_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6794
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_int128_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6793, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6796
 *                            __deref_value_ptr_int128_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6797
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6796
 *                            __deref_value_ptr_int128_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6799
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6801
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6764
 * 
 * 
 *     cpdef __TreeSeries_int128_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 6764, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 6764, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6764, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6764, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6804
 * 
 * 
 *     cpdef __TreeSeries_int128_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6804, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6804, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6804, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6804, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 6804, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6807
 * 
 *         cdef __TreeSeries_int128_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6809
 *         cdef object it = start
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6809, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6810
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6809, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6808
 *         cdef __TreeSeries_int128_t result
 *         cdef object it = start
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6808, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6812
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6814
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6814, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 6814, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6815
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6815, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6815, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6815, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6815, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6815, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6816
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6818
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6820
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6804
 * 
 * 
 *     cpdef __TreeSeries_int128_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 6804, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 6804, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 6804, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6804, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6804, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6823
 * 
 * 
 *     cpdef __TreeSeries_int128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__120;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6823, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6823, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6823, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 6823, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6830
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 6830, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6831
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 6830, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6829
 *         cdef tuple it
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6829, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6833
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 6833, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 6833, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6833, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6834
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6834, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6834, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 6834, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 6834, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6834, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6836
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6823
 * 
 * 
 *     cpdef __TreeSeries_int128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__120;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 6823, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6823, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 6823, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 6824, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6823, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6839
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__121;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6839, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6839, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6839, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6844
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6845
 * 
 *         for it in deref(self.__index):
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6846
 *         for it in deref(self.__index):
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 6846, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6845
 * 
 *         for it in deref(self.__index):
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6846
 *         for it in deref(self.__index):
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 6846, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6845
 * 
 *         for it in deref(self.__index):
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6845, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6845, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_int128_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6845, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6844
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_int128_t( it, method( __deref_value_ptr_int128_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6839
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__121;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 6839, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6839, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 6839, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 6840, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6839, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6849
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6849, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6849, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6849, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6849, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6849, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6851
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int128_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6851, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6851, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6852
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_int128_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6853
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_int128_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6849
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int128_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 6849, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6849, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6856
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6856, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6856, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6856, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6856, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6856, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6858
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 6858, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6859
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6858
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6861
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 6861, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6862
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6861
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6856
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int128_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 6856, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6856, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6865
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6865, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6865, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6865, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6867
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6868
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6865
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int128_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6865, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6871
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6871, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6871, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6873
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6874
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6871
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int128_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6871, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6877
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6877, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6877, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6877, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6877, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6881
 *         cdef tuple it
 *         cdef int128_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6881, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6883
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 6883, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6885
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <int128_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6885, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 6885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6885, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6886
 * 
 *             for it in other.iteritems():
 *                 num = <int128_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6886, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 6886, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6887
 *             for it in other.iteritems():
 *                 num = <int128_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6887, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6887, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6883
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6889
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 6889, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6890
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6890, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 6890, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6890, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6891
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6891, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6891, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6891, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6891, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6889
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6894
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 6894, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 6894, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6894, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6895
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6895, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6895, __pyx_L1_error)
      }
      __pyx_t_13 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6895, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6895, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6877
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 6877, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 6877, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 6877, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6877, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6898
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6898, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6898, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6900
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6900, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 6900, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 6900, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6901
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6901, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6900
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6903
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6898
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6898, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6898, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6908
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static void __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6910
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6908
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

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

/* "redblackpy/cython_source/tree_series_dtype.pxi":6913
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6915
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6916
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6918
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6920
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 6920, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 6920, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6921
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 6921, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 6921, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6921, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6921, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6922
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6922, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 6922, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6922, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 6922, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 6922, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6921
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6920
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6925
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6925, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6925, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 6925, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6925, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 6925, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6926
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6926, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6926, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6926, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 6926, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6926, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 6926, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6926, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 6926, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 6926, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6925
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6928
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6930
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 6930, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 6930, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6930, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 6930, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6931
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6931, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 6931, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 6931, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 6931, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 6931, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6930
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6933
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6913
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_int128_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6936
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6938
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6938, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6938, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6938, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6936
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_51generator23(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":6941
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 6941, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_51generator23, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_int128_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 6941, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_51generator23(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6941, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6945
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int128_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6946
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_int128_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 6946, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6945
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_int128_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6941
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6949
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6951
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef int128_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6954
 *         cdef int128_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6955
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6955, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6954
 *         cdef int128_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6957
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6958
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6957
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6960
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6962
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6963
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6963, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6962
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6965
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6966
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6966, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 6966, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6965
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6968
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6969
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6969, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 6969, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6968
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6949
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6972
 * 
 * 
 *     def __setitem__(self, key, int128_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_arg_value); if (unlikely((__pyx_v_value == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6972, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t)__pyx_v_value));

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

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6974
 *     def __setitem__(self, key, int128_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6975
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 6975, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6977
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int128_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6978
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_int128_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6978, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6977
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_int128_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6981
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int128_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 6981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 6981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 6981, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6982
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_int128_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_int128_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6982, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":6981
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_int128_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":6985
 * 
 *             else:
 *                 __insert_node_by_ptr_int128_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_int128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 6985, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6972
 * 
 * 
 *     def __setitem__(self, key, int128_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6991
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int128_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6991, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6991, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6991, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6991, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6991, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 6991, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6993
 *     cpdef __TreeSeries_int128_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_int128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_int128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6993, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6991
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_int128_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_int128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 6991, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6991, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6996
 * 
 * 
 *     cpdef __TreeSeries_int128_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6996, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6996, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6996, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 6996, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6996, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 6996, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6998
 *     cpdef __TreeSeries_int128_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_int128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_int128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6998, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6996
 * 
 * 
 *     cpdef __TreeSeries_int128_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_int128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 6996, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6996, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7001
 * 
 * 
 *     cpdef __TreeSeries_int128_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7001, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7001, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7001, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7001, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7001, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7001, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 7001, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7003
 *     cpdef __TreeSeries_int128_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_int128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_int128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7003, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7001
 * 
 * 
 *     cpdef __TreeSeries_int128_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_int128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 7001, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7001, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7006
 * 
 * 
 *     cpdef __TreeSeries_int128_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7006, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7006, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7006, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7006, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 7006, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7008
 *     cpdef __TreeSeries_int128_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_int128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_int128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7006
 * 
 * 
 *     cpdef __TreeSeries_int128_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_int128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 7006, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7006, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7011
 * 
 * 
 *     cpdef __TreeSeries_int128_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7011, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7011, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 7011, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7013
 *     cpdef __TreeSeries_int128_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7014
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 7014, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7013
 *     cpdef __TreeSeries_int128_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7011
 * 
 * 
 *     cpdef __TreeSeries_int128_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

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

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7011, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7017
 * 
 * 
 *     cpdef __TreeSeries_int128_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7017, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7017, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7017, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7017, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7017, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7017, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t))))) __PYX_ERR(3, 7017, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7019
 *     cpdef __TreeSeries_int128_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7020
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 7020, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7020, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7019
 *     cpdef __TreeSeries_int128_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7017
 * 
 * 
 *     cpdef __TreeSeries_int128_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7017, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7026
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7030
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7030, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7030, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7031
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7031, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 7031, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7030
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7033
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7033, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7033, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7033, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 7033, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7033, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 7033, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7033, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 7033, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 7033, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7034
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7034, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7034, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 7034, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7034, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7033
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7026
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7037
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7039
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7039, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 7039, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7039, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 7039, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7039, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 7039, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7040
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7040, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7039
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7037
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7043
 * 
 * 
 *     cdef int128_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7046
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7049
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7049, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7050
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7052
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7053
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7052
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7056
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7058
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7043
 * 
 * 
 *     cdef int128_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int128_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7063
 * 
 * 
 *     cdef int128_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7065
 *     cdef int128_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7068
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7068, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7069
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7071
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7063
 * 
 * 
 *     cdef int128_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_int128_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7076
 * 
 * 
 *     cdef __TreeSeries_int128_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7079
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int128_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7080
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7083
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7083, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7084
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7083, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7082
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7082, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7086
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7086, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7086, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 7086, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7087
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7086
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7089
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7091
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7091, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7092
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7091
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7094
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7094, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7095
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7094
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7089
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7097
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7097, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7098
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7098, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7099
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 7099, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7097
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7101
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7102
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7103
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 7103, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7101
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7105
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7106
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7105
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7108
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7105
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7110
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7111
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7110
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7113
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7113, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7114
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7115
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7114
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7113
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7118
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7119
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7120
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7120, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7118
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 7118, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7076
 * 
 * 
 *     cdef __TreeSeries_int128_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7123
 * 
 * 
 *     cdef __TreeSeries_int128_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7126
 * 
 *         cdef __TreeSeries_int128_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7128
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7129
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7132
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7132, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7132, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7133
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7132, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7131
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7131, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7134
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7135
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 7135, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7134
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7137
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 7137, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 7137, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7137, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7139
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7140
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7140, __pyx_L1_error)
      }
      __pyx_t_8 = __Pyx_PyInt_As_PY_LONG_LONG(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 7140, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7140, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7141
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7141, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7139
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7143
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7144
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7143
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7146
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7146, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 7146, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7147
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7149
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7123
 * 
 * 
 *     cdef __TreeSeries_int128_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7152
 * 
 * 
 *     cdef __TreeSeries_int128_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7155
 * 
 *         cdef __TreeSeries_int128_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7157
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7158
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7161
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7161, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7161, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7162
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7161, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7160
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7160, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7163
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7163, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7165
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7166
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 7166, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7165
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7168
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 7168, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7168, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 7168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7168, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7170
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7171
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 7171, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __Pyx_PyInt_As_PY_LONG_LONG(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 7171, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7171, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7172
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7170
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7174
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7175
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7174
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7177
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7177, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 7177, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7178
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7180
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7163
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7152
 * 
 * 
 *     cdef __TreeSeries_int128_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7183
 * 
 * 
 *     cdef __TreeSeries_int128_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int128_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7191
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7191, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7192
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7191, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7190
 *         cdef object key
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7190, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7193
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7195
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7197
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_int128_t(node), other[key])
 *             __insert_node_int128_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7198
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int128_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int128_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7198, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_2); if (unlikely((__pyx_t_6 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 7198, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_int128_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7199
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_int128_t(node), other[key])
 *             __insert_node_int128_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int128_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7199, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7195
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7201
 *             __insert_node_int128_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7203
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7183
 * 
 * 
 *     cdef __TreeSeries_int128_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_int128_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7206
 * 
 * 
 *     cdef __TreeSeries_int128_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int128_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7212
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 7212, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7215
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7215, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7216
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7215, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7214
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_int128_t result
 *         result = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7214, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7218
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7219
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7220
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7221
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7222
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7222, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 7222, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7224
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7225
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7227
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7228
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int128_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7229
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_int128_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7229, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7229, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7229, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 7229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7229, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_10 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 7229, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7229, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_t_3); if (unlikely((__pyx_t_11 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 7229, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7230
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int128_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_int128_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7230, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7231
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_int128_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7233
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7234
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7236
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_float32_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7206
 * 
 * 
 *     cdef __TreeSeries_int128_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_int128_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6641
 *     cdef arithmetic_type_int128_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 6641, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6642
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   int128_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 6642, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6643
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   int128_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":6644
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   int128_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_PY_LONG_LONG(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 6644, __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("redblackpy.series.tree_series.__TreeSeries_int128_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_PY_LONG_LONG(__pyx_v_value); if (unlikely((__pyx_t_1 == (PY_LONG_LONG)-1) && PyErr_Occurred())) __PYX_ERR(3, 6644, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_int128_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7250
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7254
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float32_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 7254, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __pyx_PyFloat_AsFloat(values[4]); if (unlikely((__pyx_v_extrapolate == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7255, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)0.0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7254, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 7254, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 7255, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 7255, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7257
 *                    str interpolate="floor", float32_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7258
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7259
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7260
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7262
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7263
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7265
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7267
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7268
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__127, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 7268, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7267
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7265
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7271
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7272
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7272, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7271
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7275
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7275, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7254
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float32_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7282
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float32_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7282, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_5insert)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7282, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7282, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7282, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 7282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7282, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7284
 *     cpdef void insert(self, key, float32_t value) except*:
 * 
 *         __insert_node_float32_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_float32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7284, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7282
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float32_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float32_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 7282, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 7282, __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_value = __pyx_PyFloat_AsFloat(values[1]); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7282, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7282, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7282, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7282, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7287
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7287, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7287, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7287, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7287, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7287, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7287, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7291
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float32_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 7291, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 7291, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7291, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7291, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7292
 * 
 *         for pair in pairs:
 *             __insert_node_float32_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7292, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7292, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsFloat(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7292, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7291
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float32_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7287
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 7287, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7287, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7287, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7295
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float32_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7295, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7295, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7295, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7295, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7295, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7295, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7297
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_float32_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_float32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7297, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7295
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float32_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7295, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7295, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7300
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7300, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7300, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7300, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7304
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_float32_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 7304, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7304, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7305
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_float32_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7305, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_float32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7305, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7300
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 7300, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7300, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7300, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7308
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7308, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7308, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7308, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7311
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7313
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float32_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7314
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_float32_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7314, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 7314, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7313
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float32_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7316
 *             result.append( __deref_value_ptr_float32_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7308
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7308, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7319
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7319, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7319, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7319, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7319, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7322
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7324
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float32_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7325
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float32_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7326
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float32_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7325
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float32_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 7325, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7324
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float32_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7328
 *                              __deref_value_ptr_float32_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7319
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7319, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_18generator24(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":7331
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 7331, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_18generator24, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_float32_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 7331, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_18generator24(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 7331, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7335
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float32_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7336
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float32_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7336, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 7336, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7335
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float32_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7331
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7339
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7339, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7339, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7339, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7339, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7339, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7343
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7344
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7344, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7346
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7347
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__128);
    __pyx_r = __pyx_tuple__128;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7346
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7349
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float32_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7350
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_float32_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7349
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float32_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7339
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.floor", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7339, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7353
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7353, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7353, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7353, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7353, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7353, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7353, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7357
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7358
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7358, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7360
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7361
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__129);
    __pyx_r = __pyx_tuple__129;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7360
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7363
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float32_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7364
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_float32_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7363
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float32_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7353
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.ceil", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7353, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7367
 * 
 * 
 *     cpdef __TreeSeries_float32_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7367, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7367, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7367, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7367, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7375
 *         cdef __TreeSeries_float32_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7376
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7379
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7379, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7380
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7379, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7378
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7378, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7382
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7382, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7383
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7383, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7384
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7385
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7387
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7388
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7387
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7390
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7387
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7392
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7392, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 7392, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7393
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7392
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7395
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float32_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7396
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_float32_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7397
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float32_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7396, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7399
 *                            __deref_value_ptr_float32_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7400
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7399
 *                            __deref_value_ptr_float32_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7402
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7404
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7367
 * 
 * 
 *     cpdef __TreeSeries_float32_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 7367, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 7367, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7367, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7367, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7407
 * 
 * 
 *     cpdef __TreeSeries_float32_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7407, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7407, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7407, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7407, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7407, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7410
 * 
 *         cdef __TreeSeries_float32_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7412
 *         cdef object it = start
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7412, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7413
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7412, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7411
 *         cdef __TreeSeries_float32_t result
 *         cdef object it = start
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7411, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7415
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7417
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7417, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 7417, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7418
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7418, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7418, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7418, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7418, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7418, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7419
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7419, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7421
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7423
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7407
 * 
 * 
 *     cpdef __TreeSeries_float32_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 7407, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 7407, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 7407, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7407, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7407, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7426
 * 
 * 
 *     cpdef __TreeSeries_float32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__130;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7426, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7426, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7426, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7433
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7433, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7433, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7434
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7433, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7432
 *         cdef tuple it
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7432, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7436
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 7436, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7436, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 7436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7436, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7437
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7437, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7437, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 7437, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 7437, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7437, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7437, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7439
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7426
 * 
 * 
 *     cpdef __TreeSeries_float32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__130;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 7426, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7426, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 7426, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 7427, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7426, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7442
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__131;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7442, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7442, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7447
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7448
 * 
 *         for it in deref(self.__index):
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7449
 *         for it in deref(self.__index):
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 7449, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7448
 * 
 *         for it in deref(self.__index):
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7449
 *         for it in deref(self.__index):
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 7449, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7448
 * 
 *         for it in deref(self.__index):
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7448, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7448, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_float32_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7448, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7447
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float32_t( it, method( __deref_value_ptr_float32_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7442
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__131;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 7442, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7442, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 7442, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 7443, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7442, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7452
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7452, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7452, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7452, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7452, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7454
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float32_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7454, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7454, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7455
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_float32_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7456
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float32_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7452
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float32_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 7452, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7452, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7459
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7459, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7459, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7459, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7459, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7459, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7461
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 7461, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7462
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7461
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7464
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 7464, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7465
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7464
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7459
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float32_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 7459, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7459, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7468
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7468, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7468, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7468, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7470
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7471
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7468
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float32_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7468, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7474
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7474, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7474, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7476
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7477
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7474
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float32_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7474, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7480
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7480, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7480, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7480, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7480, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7480, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7484
 *         cdef tuple it
 *         cdef float32_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7484, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7486
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 7486, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7488
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <float32_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 7488, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 7488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7488, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7489
 * 
 *             for it in other.iteritems():
 *                 num = <float32_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7489, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 7489, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7490
 *             for it in other.iteritems():
 *                 num = <float32_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7490, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7490, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7486
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7492
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 7492, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7493
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 7493, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 7493, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7493, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7494
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7494, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7494, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7494, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7494, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7494, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7492
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7497
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 7497, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 7497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7497, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7498
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7498, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7498, __pyx_L1_error)
      }
      __pyx_t_13 = __pyx_PyFloat_AsFloat(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7498, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7498, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7480
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 7480, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7480, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 7480, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7480, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7480, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7501
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7501, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7501, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7503
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 7503, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 7503, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7504
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7504, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7503
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7506
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7501
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7501, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7501, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7511
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7513
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7511
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7516
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7518
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7519
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7519, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7521
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7523
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 7523, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7523, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7524
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 7524, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 7524, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7524, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7524, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7525
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7525, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 7525, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7525, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 7525, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7525, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 7525, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7524
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7523
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7528
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7528, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 7528, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7528, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7529
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7529, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 7529, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7529, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 7529, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 7529, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7528
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7531
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7533
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7533, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7533, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 7533, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7533, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 7533, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7534
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7534, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 7534, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7534, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 7534, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7534, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7533
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7536
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7516
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_float32_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7539
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7541
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7541, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7541, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7539
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_51generator25(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":7544
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 7544, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_51generator25, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_float32_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 7544, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_51generator25(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 7544, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7548
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float32_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7549
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_float32_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 7549, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7548
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float32_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7544
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7552
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7554
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef float32_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7557
 *         cdef float32_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7558
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7558, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7557
 *         cdef float32_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7560
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7561
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7560
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7563
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7565
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7566
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7565
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7568
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7569
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 7569, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7568
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7571
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7572
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7572, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 7572, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7571
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7552
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7575
 * 
 * 
 *     def __setitem__(self, key, float32_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsFloat(__pyx_arg_value); if (unlikely((__pyx_v_value == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7575, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7577
 *     def __setitem__(self, key, float32_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7578
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7578, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7580
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float32_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7581
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_float32_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7581, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7580
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float32_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7584
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float32_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 7584, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7585
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_float32_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_float32_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7585, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7584
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float32_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7588
 * 
 *             else:
 *                 __insert_node_by_ptr_float32_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float32_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7588, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7575
 * 
 * 
 *     def __setitem__(self, key, float32_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7594
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float32_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7594, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7594, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7594, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7594, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7594, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7594, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7594, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7596
 *     cpdef __TreeSeries_float32_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_float32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_float32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7594
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float32_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 7594, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7594, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7599
 * 
 * 
 *     cpdef __TreeSeries_float32_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7599, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7599, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7599, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7599, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7599, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7601
 *     cpdef __TreeSeries_float32_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_float32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_float32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7599
 * 
 * 
 *     cpdef __TreeSeries_float32_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 7599, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7599, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7604
 * 
 * 
 *     cpdef __TreeSeries_float32_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7604, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7604, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7604, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7604, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7604, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7606
 *     cpdef __TreeSeries_float32_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_float32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_float32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7604
 * 
 * 
 *     cpdef __TreeSeries_float32_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 7604, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7604, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7609
 * 
 * 
 *     cpdef __TreeSeries_float32_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float32_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7609, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7609, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7609, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7609, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7609, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7611
 *     cpdef __TreeSeries_float32_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_float32_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_float32_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7609
 * 
 * 
 *     cpdef __TreeSeries_float32_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float32_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 7609, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7609, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7614
 * 
 * 
 *     cpdef __TreeSeries_float32_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7614, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7614, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7614, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7616
 *     cpdef __TreeSeries_float32_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7617
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 7617, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7617, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7616
 *     cpdef __TreeSeries_float32_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7614
 * 
 * 
 *     cpdef __TreeSeries_float32_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7614, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7620
 * 
 * 
 *     cpdef __TreeSeries_float32_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7620, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7620, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7620, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7620, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7620, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7620, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t))))) __PYX_ERR(3, 7620, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7622
 *     cpdef __TreeSeries_float32_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7623
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 7623, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7623, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7622
 *     cpdef __TreeSeries_float32_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7620
 * 
 * 
 *     cpdef __TreeSeries_float32_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7620, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7629
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7633
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7633, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7633, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7634
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__132, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 7634, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7633
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7636
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7636, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7636, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7636, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 7636, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 7636, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7636, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 7636, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 7636, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7637
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7637, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7637, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsFloat(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7637, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7637, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7636
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7629
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7640
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7642
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7642, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 7642, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7642, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 7642, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7642, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 7642, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7643
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0.0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7643, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7642
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7640
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7646
 * 
 * 
 *     cdef float32_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7649
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7652
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7652, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7653
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7655
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7656
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7655
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7659
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7661
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7646
 * 
 * 
 *     cdef float32_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float32_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7666
 * 
 * 
 *     cdef float32_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7668
 *     cdef float32_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7671
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7671, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7672
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7674
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7666
 * 
 * 
 *     cdef float32_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float32_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7679
 * 
 * 
 *     cdef __TreeSeries_float32_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7682
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float32_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7683
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7686
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7686, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7687
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7686, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7685
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7685, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7689
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7689, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7689, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7689, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 7689, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7690
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7689
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7692
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7692, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7694
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7694, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7695
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7694
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7697
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 7697, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7698
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7697
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7692
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7700
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7701
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7701, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7702
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 7702, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7700
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7704
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7705
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7705, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7706
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 7706, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7704
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7708
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7709
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7708
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7711
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7708
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7713
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7714
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7713
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7716
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7716, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7717
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7718
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7717
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7717, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7716
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7721
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7722
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7722, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7723
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7723, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7721
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 7721, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7679
 * 
 * 
 *     cdef __TreeSeries_float32_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7726
 * 
 * 
 *     cdef __TreeSeries_float32_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7729
 * 
 *         cdef __TreeSeries_float32_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7731
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7732
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7735
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7735, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7735, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7736
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7735, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7734
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7734, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7737
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7738
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__133, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 7738, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7737
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7740
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 7740, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7740, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 7740, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7740, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7742
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7743
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7743, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_PyFloat_AsFloat(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7743, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7743, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7744
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7744, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7742
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7746
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7747
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7746
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7749
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7749, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 7749, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7750
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7752
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7726
 * 
 * 
 *     cdef __TreeSeries_float32_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7755
 * 
 * 
 *     cdef __TreeSeries_float32_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7758
 * 
 *         cdef __TreeSeries_float32_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7760
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7761
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7764
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7764, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7764, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7765
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7764, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7763
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7763, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7766
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7766, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7768
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7769
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__134, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7769, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 7769, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7768
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7771
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 7771, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7771, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 7771, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 7771, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7773
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7774
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 7774, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __pyx_PyFloat_AsFloat(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7774, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7774, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7775
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7775, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7773
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7777
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7778
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":7777
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7780
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 7780, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 7780, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7781
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7783
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7766
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7755
 * 
 * 
 *     cdef __TreeSeries_float32_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7786
 * 
 * 
 *     cdef __TreeSeries_float32_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float32_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7794
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7794, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7795
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7794, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7793
 *         cdef object key
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7793, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7796
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7798
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7800
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_float32_t(node), other[key])
 *             __insert_node_float32_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7801
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float32_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float32_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7801, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_6 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7801, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float32_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7802
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float32_t(node), other[key])
 *             __insert_node_float32_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float32_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7802, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7798
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7804
 *             __insert_node_float32_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7806
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7786
 * 
 * 
 *     cdef __TreeSeries_float32_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float32_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7809
 * 
 * 
 *     cdef __TreeSeries_float32_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float32_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7815
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 7815, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7818
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7818, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7819
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7818, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7817
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_float32_t result
 *         result = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7817, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7821
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7822
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7823
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7824
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7825
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7825, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 7825, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7827
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7828
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7830
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7831
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float32_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7832
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float32_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7832, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7832, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7832, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 7832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7832, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_10 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7832, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7832, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_11 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7832, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7833
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float32_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float32_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7833, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7834
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float32_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7836
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7837
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7839
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_float64_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7809
 * 
 * 
 *     cdef __TreeSeries_float32_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float32_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7244
 *     cdef arithmetic_type_float32_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 7244, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7245
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   float32_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 7245, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7246
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   float32_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7247
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   float32_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7247, __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("redblackpy.series.tree_series.__TreeSeries_float32_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_value); if (unlikely((__pyx_t_1 == (float)-1) && PyErr_Occurred())) __PYX_ERR(3, 7247, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__135, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__136, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float32_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7853
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7857
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float64_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 7857, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_extrapolate == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7858, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)0.0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7857, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 7857, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 7858, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 7858, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7860
 *                    str interpolate="floor", float64_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7861
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7862
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7863
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7865
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7866
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7868
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7870
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7871
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__137, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7871, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 7871, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7870
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7868
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7874
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7875
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7875, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":7874
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7878
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7878, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7857
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float64_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7885
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float64_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7885, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_5insert)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7885, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7885, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7885, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 7885, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7885, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7887
 *     cpdef void insert(self, key, float64_t value) except*:
 * 
 *         __insert_node_float64_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_float64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7887, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7885
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float64_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float64_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 7885, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 7885, __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_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7885, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7885, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7885, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7885, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7890
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7890, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7890, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7890, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7890, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7890, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7890, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7894
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float64_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 7894, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 7894, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7894, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7894, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7895
 * 
 *         for pair in pairs:
 *             __insert_node_float64_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7895, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7895, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7895, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7895, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7894
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float64_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7890
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 7890, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7890, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7890, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7898
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float64_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7898, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7898, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7898, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7898, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7898, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7900
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_float64_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_float64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7900, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7898
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float64_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7898, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7898, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7903
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7903, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7903, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7903, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7903, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7903, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7907
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_float64_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 7907, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 7907, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7908
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_float64_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 7908, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_float64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7908, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7903
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 7903, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7903, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7903, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7911
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7911, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7911, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7911, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7914
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7916
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float64_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7917
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_float64_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7917, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 7917, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7916
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float64_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7919
 *             result.append( __deref_value_ptr_float64_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7911
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7911, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7922
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7922, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7922, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7922, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7925
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7927
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float64_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7928
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float64_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7929
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float64_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7928
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float64_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 7928, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7927
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float64_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7931
 *                              __deref_value_ptr_float64_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7922
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7922, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_18generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":7934
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 7934, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_18generator26, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_float64_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 7934, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_18generator26(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 7934, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7938
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float64_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7939
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float64_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 7939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7939, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 7939, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7938
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float64_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7934
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7942
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7942, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7942, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7942, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7942, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7942, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7942, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7942, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7946
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7947
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7947, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7949
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7950
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__138);
    __pyx_r = __pyx_tuple__138;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7949
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7952
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float64_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7953
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_float64_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7952
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float64_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7952, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7942
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.floor", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7942, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7956
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7956, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7956, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7956, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7956, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 7956, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7956, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 7956, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7960
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7961
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7961, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7963
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7964
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__139);
    __pyx_r = __pyx_tuple__139;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7963
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7966
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float64_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7967
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_float64_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7966
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float64_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7956
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.ceil", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7956, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7970
 * 
 * 
 *     cpdef __TreeSeries_float64_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7970, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7970, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 7970, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7970, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 7970, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7978
 *         cdef __TreeSeries_float64_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7979
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7982
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7982, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 7982, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7983
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 7982, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7981
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7981, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7985
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7985, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7986
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 7986, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7987
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7988
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7990
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7991
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7990
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7993
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7990
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7995
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7995, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 7995, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7996
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7995
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7998
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float64_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":7999
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_float64_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 7999, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8000
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float64_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 7999, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8002
 *                            __deref_value_ptr_float64_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8003
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8002
 *                            __deref_value_ptr_float64_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8005
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8007
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7970
 * 
 * 
 *     cpdef __TreeSeries_float64_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 7970, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 7970, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 7970, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7970, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8010
 * 
 * 
 *     cpdef __TreeSeries_float64_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8010, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8010, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8010, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8010, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8010, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8013
 * 
 *         cdef __TreeSeries_float64_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8015
 *         cdef object it = start
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8015, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8016
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8015, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8014
 *         cdef __TreeSeries_float64_t result
 *         cdef object it = start
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8014, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8018
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8020
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8020, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 8020, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8021
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8021, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8021, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8021, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8021, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8021, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8021, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8021, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8022
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8022, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8024
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8026
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8010
 * 
 * 
 *     cpdef __TreeSeries_float64_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 8010, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 8010, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 8010, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8010, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8010, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8029
 * 
 * 
 *     cpdef __TreeSeries_float64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__140;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8029, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8029, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8029, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8029, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8029, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8036
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8036, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8036, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8037
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8036, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8035
 *         cdef tuple it
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8035, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8039
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 8039, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 8039, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8039, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8040
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8040, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8040, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 8040, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 8040, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8040, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8040, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8040, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8042
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8029
 * 
 * 
 *     cpdef __TreeSeries_float64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__140;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 8029, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8029, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 8029, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 8030, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8029, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8045
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__141;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8045, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8045, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8045, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8050
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8051
 * 
 *         for it in deref(self.__index):
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8052
 *         for it in deref(self.__index):
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 8052, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8051
 * 
 *         for it in deref(self.__index):
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8052
 *         for it in deref(self.__index):
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 8052, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8051
 * 
 *         for it in deref(self.__index):
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8051, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8051, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_float64_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8051, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8050
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float64_t( it, method( __deref_value_ptr_float64_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8045
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__141;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 8045, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8045, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 8045, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 8046, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8045, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8045, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8055
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8055, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8055, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8055, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8055, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8055, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8055, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8057
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float64_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8057, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8058
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_float64_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8059
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float64_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8055
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float64_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 8055, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8055, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8062
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8062, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8062, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8062, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8062, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8062, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8064
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 8064, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8065
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8064
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8067
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 8067, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8068
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8067
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8062
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float64_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 8062, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8062, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8071
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8071, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8071, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8071, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8073
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8074
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8071
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float64_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8071, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8077
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8077, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8077, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8077, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8079
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8080
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8077
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float64_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8077, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8083
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8083, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8083, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8083, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8083, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8083, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8087
 *         cdef tuple it
 *         cdef float64_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8087, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8089
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 8089, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8091
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <float64_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8091, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 8091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8091, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8092
 * 
 *             for it in other.iteritems():
 *                 num = <float64_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8092, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 8092, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8093
 *             for it in other.iteritems():
 *                 num = <float64_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8093, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8093, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8089
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8095
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 8095, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8096
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8096, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8096, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 8096, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8096, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8097
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8097, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8097, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8097, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8097, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8097, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8095
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8100
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8100, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 8100, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8100, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8101
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8101, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8101, __pyx_L1_error)
      }
      __pyx_t_13 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8101, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8101, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8083
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 8083, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8083, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 8083, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8083, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8104
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8104, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8104, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8106
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8106, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 8106, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 8106, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8107
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8107, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8106
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8109
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8104
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8104, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8104, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8114
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8116
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8114
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8119
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8121
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8122
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8124
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8126
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 8126, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8126, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8127
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 8127, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 8127, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8127, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8127, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8128
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8128, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 8128, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8128, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 8128, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 8128, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8127
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8126
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8131
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8131, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 8131, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8131, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8132
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8132, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 8132, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8132, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 8132, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 8132, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8131
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8134
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8136
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8136, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8136, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 8136, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 8136, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8137
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8137, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 8137, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8137, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 8137, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8137, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8136
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8139
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8119
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_float64_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8142
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8144
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8144, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8144, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8144, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8142
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_51generator27(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":8147
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 8147, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_51generator27, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_float64_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 8147, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_51generator27(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 8147, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8151
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float64_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8152
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_float64_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 8152, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8151
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float64_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8147
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8155
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8157
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef float64_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8160
 *         cdef float64_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8161
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8160
 *         cdef float64_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8163
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8164
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8164, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8163
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8166
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8168
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8169
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8168
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8171
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8172
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 8172, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8171
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8174
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8175
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 8175, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8174
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8155
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8178
 * 
 * 
 *     def __setitem__(self, key, float64_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8178, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8180
 *     def __setitem__(self, key, float64_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8181
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8181, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8183
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float64_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8184
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_float64_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8184, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8183
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float64_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8187
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float64_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8187, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 8187, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8188
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_float64_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_float64_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8188, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8187
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float64_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8191
 * 
 *             else:
 *                 __insert_node_by_ptr_float64_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float64_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8191, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8178
 * 
 * 
 *     def __setitem__(self, key, float64_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8197
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float64_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8197, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8197, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8197, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8197, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8197, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8197, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8197, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8199
 *     cpdef __TreeSeries_float64_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_float64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_float64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8199, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8197
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float64_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8197, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8197, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8202
 * 
 * 
 *     cpdef __TreeSeries_float64_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8202, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8202, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8202, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8202, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8202, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8202, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8202, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8204
 *     cpdef __TreeSeries_float64_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_float64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_float64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8202
 * 
 * 
 *     cpdef __TreeSeries_float64_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8202, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8202, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8207
 * 
 * 
 *     cpdef __TreeSeries_float64_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8207, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8207, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8207, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8207, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8207, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8207, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8209
 *     cpdef __TreeSeries_float64_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_float64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_float64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8207
 * 
 * 
 *     cpdef __TreeSeries_float64_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8207, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8207, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8212
 * 
 * 
 *     cpdef __TreeSeries_float64_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float64_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8212, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8212, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8212, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8212, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8214
 *     cpdef __TreeSeries_float64_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_float64_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_float64_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8212
 * 
 * 
 *     cpdef __TreeSeries_float64_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float64_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8212, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8212, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8217
 * 
 * 
 *     cpdef __TreeSeries_float64_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8217, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8217, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8217, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8217, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8217, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8219
 *     cpdef __TreeSeries_float64_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8220
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 8220, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8219
 *     cpdef __TreeSeries_float64_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8217
 * 
 * 
 *     cpdef __TreeSeries_float64_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8217, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8223
 * 
 * 
 *     cpdef __TreeSeries_float64_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8223, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8223, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8223, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t))))) __PYX_ERR(3, 8223, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8225
 *     cpdef __TreeSeries_float64_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8226
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 8226, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8226, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8225
 *     cpdef __TreeSeries_float64_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8223
 * 
 * 
 *     cpdef __TreeSeries_float64_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8223, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8232
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8236
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8236, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8236, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8237
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__142, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8237, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 8237, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8236
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8239
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8239, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8239, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 8239, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 8239, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8239, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 8239, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 8239, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8240
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8240, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8240, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8240, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8240, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8239
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8232
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8243
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8245
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8245, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 8245, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 8245, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8245, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 8245, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8246
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0.0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8246, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8245
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8243
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8249
 * 
 * 
 *     cdef float64_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8252
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8255
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8255, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8256
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8258
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8259
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8258
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8262
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8264
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8249
 * 
 * 
 *     cdef float64_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float64_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8269
 * 
 * 
 *     cdef float64_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8271
 *     cdef float64_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8274
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8274, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8275
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8277
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8269
 * 
 * 
 *     cdef float64_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float64_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8282
 * 
 * 
 *     cdef __TreeSeries_float64_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8285
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float64_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8286
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8289
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8289, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8290
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8289, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8288
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8288, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8292
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8292, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 8292, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8293
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8292
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8295
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8297
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8298
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8297
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8300
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8301
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8300
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8295
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8303
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8304
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8304, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8305
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 8305, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8303
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8307
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8308
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8309
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 8309, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8307
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8311
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8312
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8311
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8314
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8311
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8316
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8317
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8316
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8319
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8320
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8321
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8321, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8320
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8319
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8324
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8325
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8326
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8326, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8324
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 8324, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8282
 * 
 * 
 *     cdef __TreeSeries_float64_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8329
 * 
 * 
 *     cdef __TreeSeries_float64_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8332
 * 
 *         cdef __TreeSeries_float64_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8334
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8335
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8338
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8338, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8339
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8338, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8337
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8337, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8340
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8341
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__143, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 8341, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8340
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8343
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 8343, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8343, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 8343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8343, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8345
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8346
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8346, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8346, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8346, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8347
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8347, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8345
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8349
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8350
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8349
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8352
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8352, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 8352, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8353
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8355
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8329
 * 
 * 
 *     cdef __TreeSeries_float64_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8358
 * 
 * 
 *     cdef __TreeSeries_float64_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8361
 * 
 *         cdef __TreeSeries_float64_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8363
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8364
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8367
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8367, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8368
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8367, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8366
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8366, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8369
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8371
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8372
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__144, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 8372, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8371
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8374
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8374, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8374, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 8374, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8374, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8376
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8377
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 8377, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8377, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8377, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8378
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8376
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8380
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8381
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8380
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8383
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8383, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 8383, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8384
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8386
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8369
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8358
 * 
 * 
 *     cdef __TreeSeries_float64_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8389
 * 
 * 
 *     cdef __TreeSeries_float64_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float64_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8397
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8397, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8398
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8397, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8396
 *         cdef object key
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8396, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8399
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8401
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8403
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_float64_t(node), other[key])
 *             __insert_node_float64_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8404
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float64_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float64_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8404, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float64_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8405
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float64_t(node), other[key])
 *             __insert_node_float64_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float64_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8405, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8401
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8407
 *             __insert_node_float64_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8409
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8389
 * 
 * 
 *     cdef __TreeSeries_float64_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float64_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8412
 * 
 * 
 *     cdef __TreeSeries_float64_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float64_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8418
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 8418, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8421
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8421, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8422
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8421, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8420
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_float64_t result
 *         result = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8420, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8424
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8425
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8426
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8427
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8428
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8428, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 8428, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8430
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8431
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8433
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8434
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float64_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8435
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float64_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8435, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8435, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 8435, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8435, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8435, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8435, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8436
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float64_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float64_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8436, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8437
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float64_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8439
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8440
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8442
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_float80_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8412
 * 
 * 
 *     cdef __TreeSeries_float64_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float64_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7847
 *     cdef arithmetic_type_float64_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 7847, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7848
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   float64_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 7848, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7849
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   float64_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":7850
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   float64_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 7850, __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("redblackpy.series.tree_series.__TreeSeries_float64_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(3, 7850, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__145, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__146, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float64_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8456
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8460
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float80_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 8460, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_extrapolate == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8461, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)0.0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8460, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 8460, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 8461, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 8461, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8463
 *                    str interpolate="floor", float80_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8464
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8465
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8466
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8468
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8469
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8471
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8473
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8474
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__147, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8474, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 8474, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8473
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8471
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8477
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8478
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8478, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8477
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8481
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8481, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8460
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float80_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8488
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float80_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float80_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8488, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_5insert)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8488, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8488, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8488, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 8488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8488, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8490
 *     cpdef void insert(self, key, float80_t value) except*:
 * 
 *         __insert_node_float80_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_float80_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8490, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8488
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float80_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float80_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 8488, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 8488, __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_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_value == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8488, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8488, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8488, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8493
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8493, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8493, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8493, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8493, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8493, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8497
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float80_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 8497, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 8497, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8497, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8497, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8498
 * 
 *         for pair in pairs:
 *             __insert_node_float80_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8498, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8498, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8498, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float80_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8498, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8497
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float80_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8493
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 8493, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8493, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8493, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8501
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float80_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8501, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8501, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8501, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8501, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8501, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8501, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8503
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_float80_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_float80_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8503, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8501
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float80_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8501, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8501, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8506
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8506, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8506, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8506, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8506, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8506, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8510
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_float80_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 8510, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8510, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8511
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_float80_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8511, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_float80_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8511, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8506
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 8506, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8506, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8506, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8514
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8514, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8514, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8514, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8517
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8519
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float80_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8520
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_float80_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8520, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 8520, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8519
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float80_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8522
 *             result.append( __deref_value_ptr_float80_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8514
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8514, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8525
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8525, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8525, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8525, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8525, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8528
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8530
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float80_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8531
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float80_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8532
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float80_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8531
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float80_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 8531, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8530
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float80_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8534
 *                              __deref_value_ptr_float80_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8525
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8525, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_18generator28(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":8537
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 8537, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_18generator28, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_float80_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 8537, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_18generator28(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 8537, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8541
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float80_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8542
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float80_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 8542, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8541
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float80_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8537
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8545
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8545, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8545, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8545, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8545, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8545, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8545, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8549
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8550
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8550, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8552
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8553
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__148);
    __pyx_r = __pyx_tuple__148;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8552
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8555
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float80_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8556
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_float80_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8555
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float80_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8545
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.floor", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8545, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8559
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8559, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8559, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8559, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8559, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8563
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8564
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8564, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8566
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8567
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__149);
    __pyx_r = __pyx_tuple__149;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8566
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8569
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float80_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8570
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_float80_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8570, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8569
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float80_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8559
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.ceil", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8559, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8573
 * 
 * 
 *     cpdef __TreeSeries_float80_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8573, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8573, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8573, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8573, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8573, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8573, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8581
 *         cdef __TreeSeries_float80_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8582
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8585
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8585, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8586
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8585, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8584
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8584, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8588
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8588, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8589
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8589, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8590
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8591
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8593
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8594
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8593
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8596
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8593
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8598
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8598, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 8598, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8599
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8598
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8601
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float80_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8602
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_float80_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8603
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float80_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8602, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8605
 *                            __deref_value_ptr_float80_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8606
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8605
 *                            __deref_value_ptr_float80_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8608
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8610
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8573
 * 
 * 
 *     cpdef __TreeSeries_float80_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 8573, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 8573, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8573, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8573, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8613
 * 
 * 
 *     cpdef __TreeSeries_float80_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8613, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8613, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8613, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8613, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8613, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8616
 * 
 *         cdef __TreeSeries_float80_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8618
 *         cdef object it = start
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8618, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8619
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8618, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8617
 *         cdef __TreeSeries_float80_t result
 *         cdef object it = start
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8617, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8621
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8623
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8623, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 8623, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8624
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8624, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8624, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8624, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8624, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8624, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8624, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8625
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8625, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8627
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8629
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8613
 * 
 * 
 *     cpdef __TreeSeries_float80_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 8613, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 8613, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 8613, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8613, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8613, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8632
 * 
 * 
 *     cpdef __TreeSeries_float80_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__150;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8632, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8632, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8632, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8632, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8639
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8639, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8640
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8639, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8638
 *         cdef tuple it
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8638, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8642
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 8642, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 8642, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8642, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8643
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8643, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8643, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 8643, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 8643, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8643, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8645
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8632
 * 
 * 
 *     cpdef __TreeSeries_float80_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__150;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 8632, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8632, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 8632, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 8633, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8632, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8648
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__151;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8648, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8648, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8648, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8653
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8654
 * 
 *         for it in deref(self.__index):
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8655
 *         for it in deref(self.__index):
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 8655, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8654
 * 
 *         for it in deref(self.__index):
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8655
 *         for it in deref(self.__index):
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 8655, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8654
 * 
 *         for it in deref(self.__index):
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8654, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8654, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_float80_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8654, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8653
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float80_t( it, method( __deref_value_ptr_float80_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8648
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__151;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 8648, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8648, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 8648, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 8649, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8648, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8648, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8658
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8658, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8658, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8658, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8658, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8658, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8658, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8660
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float80_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8660, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8660, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8661
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_float80_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8662
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float80_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8658
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float80_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 8658, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8658, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8665
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8665, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8665, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8665, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8665, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8665, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8665, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8667
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 8667, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8668
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8667
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8670
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 8670, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8671
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8670
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8665
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float80_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 8665, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8665, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8674
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8674, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8674, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8674, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8676
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8677
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8674
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float80_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8674, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8680
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8680, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8680, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8682
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8683
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8680
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float80_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8680, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8686
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8686, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8686, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8686, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8686, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8686, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8690
 *         cdef tuple it
 *         cdef float80_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8690, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8692
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 8692, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8694
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <float80_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8694, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 8694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8694, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8695
 * 
 *             for it in other.iteritems():
 *                 num = <float80_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8695, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 8695, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8696
 *             for it in other.iteritems():
 *                 num = <float80_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8696, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8696, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8692
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8698
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 8698, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8699
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8699, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 8699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8699, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8700
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8700, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8700, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_13 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8700, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8700, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8698
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8703
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8703, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 8703, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8703, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8704
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8704, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8704, __pyx_L1_error)
      }
      __pyx_t_13 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8704, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8704, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8686
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 8686, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 8686, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 8686, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8686, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8686, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8707
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8707, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8707, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8709
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 8709, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 8709, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8710
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8710, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8709
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8712
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8707
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8707, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8707, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8717
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8719
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8717
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8722
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8724
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8725
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8727
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8727, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8729
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 8729, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8729, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8730
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 8730, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 8730, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8730, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8731
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8731, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 8731, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8731, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 8731, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8731, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 8731, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8730
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8729
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8734
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8734, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8734, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 8734, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8734, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 8734, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8735
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8735, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 8735, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8735, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 8735, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8735, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 8735, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8734
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8737
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8739
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8739, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8739, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 8739, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 8739, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8740
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8740, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 8740, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8740, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 8740, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8740, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8739
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8742
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8722
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_float80_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8745
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8747
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8747, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8747, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8747, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8745
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_51generator29(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":8750
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 8750, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_51generator29, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_float80_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 8750, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_51generator29(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 8750, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8754
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float80_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8755
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_float80_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 8755, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8754
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float80_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8750
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8758
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8760
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef float80_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8763
 *         cdef float80_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8764
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8764, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8763
 *         cdef float80_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8766
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8767
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8767, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8766
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8769
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8771
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8772
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8772, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8771
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8774
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8775
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 8775, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8774
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8777
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8778
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8778, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 8778, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8777
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8758
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8781
 * 
 * 
 *     def __setitem__(self, key, float80_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8781, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8783
 *     def __setitem__(self, key, float80_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8784
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8784, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8786
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float80_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8787
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_float80_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float80_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8787, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8786
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float80_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8790
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float80_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8790, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8790, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 8790, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8791
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_float80_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_float80_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8791, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8790
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float80_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8794
 * 
 *             else:
 *                 __insert_node_by_ptr_float80_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float80_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8794, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8781
 * 
 * 
 *     def __setitem__(self, key, float80_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8800
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float80_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float80_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8800, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8800, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8800, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8800, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8800, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8802
 *     cpdef __TreeSeries_float80_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_float80_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_float80_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8800
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float80_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float80_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8800, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8800, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8805
 * 
 * 
 *     cpdef __TreeSeries_float80_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float80_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8805, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8805, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8805, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8805, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8807
 *     cpdef __TreeSeries_float80_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_float80_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_float80_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8807, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8805
 * 
 * 
 *     cpdef __TreeSeries_float80_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float80_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8805, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8805, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8810
 * 
 * 
 *     cpdef __TreeSeries_float80_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float80_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8810, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8810, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8810, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8810, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8810, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8810, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8810, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8812
 *     cpdef __TreeSeries_float80_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_float80_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_float80_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8812, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8810
 * 
 * 
 *     cpdef __TreeSeries_float80_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float80_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8810, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8810, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8815
 * 
 * 
 *     cpdef __TreeSeries_float80_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float80_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8815, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8815, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8815, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8815, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8815, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8817
 *     cpdef __TreeSeries_float80_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_float80_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_float80_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8815
 * 
 * 
 *     cpdef __TreeSeries_float80_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float80_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 8815, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8815, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8820
 * 
 * 
 *     cpdef __TreeSeries_float80_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8820, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8820, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8820, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8820, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8820, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8820, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8820, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8822
 *     cpdef __TreeSeries_float80_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8823
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 8823, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8823, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8822
 *     cpdef __TreeSeries_float80_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8820
 * 
 * 
 *     cpdef __TreeSeries_float80_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8820, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8826
 * 
 * 
 *     cpdef __TreeSeries_float80_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8826, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8826, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8826, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8826, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t))))) __PYX_ERR(3, 8826, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8828
 *     cpdef __TreeSeries_float80_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8829
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 8829, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8828
 *     cpdef __TreeSeries_float80_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8826
 * 
 * 
 *     cpdef __TreeSeries_float80_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8826, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8835
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8839
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8839, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 8839, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8840
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__152, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8840, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 8840, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8839
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8842
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8842, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8842, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 8842, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 8842, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 8842, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 8842, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 8842, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 8842, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8843
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8843, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8843, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8843, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8843, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8842
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8835
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8846
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8848
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8848, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 8848, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8848, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 8848, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 8848, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 8848, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8849
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0.0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8849, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8848
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8846
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8852
 * 
 * 
 *     cdef float80_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8855
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8858
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8858, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8859
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8861
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8862
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8861
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8865
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8867
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8852
 * 
 * 
 *     cdef float80_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float80_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8872
 * 
 * 
 *     cdef float80_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8874
 *     cdef float80_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8877
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 8877, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8878
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8880
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8872
 * 
 * 
 *     cdef float80_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float80_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8885
 * 
 * 
 *     cdef __TreeSeries_float80_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8888
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float80_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8889
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8892
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8892, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8893
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8892, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8891
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8891, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8895
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8895, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8895, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 8895, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8896
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8895
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8898
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8900
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8900, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8901
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8900
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8903
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 8903, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8904
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8903
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8898
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8906
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8907
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8908
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 8908, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8906
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8910
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8911
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8911, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8912
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 8912, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8910
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8914
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8915
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8914
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8917
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8914
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8919
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8920
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8919
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8922
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8923
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8924
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8924, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8923
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8923, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8922
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8927
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 8927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8928
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8928, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8929
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8927
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 8927, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8885
 * 
 * 
 *     cdef __TreeSeries_float80_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8932
 * 
 * 
 *     cdef __TreeSeries_float80_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8935
 * 
 *         cdef __TreeSeries_float80_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8937
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8938
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8941
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8941, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8942
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8941, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8940
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8940, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8943
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8944
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__153, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8944, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 8944, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8943
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8946
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 8946, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 8946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8946, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8948
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8949
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8949, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8949, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8949, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8950
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8950, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8948
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8952
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8953
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8952
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8955
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 8955, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 8955, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8956
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8958
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8932
 * 
 * 
 *     cdef __TreeSeries_float80_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8961
 * 
 * 
 *     cdef __TreeSeries_float80_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8964
 * 
 *         cdef __TreeSeries_float80_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8966
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8967
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8970
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 8970, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8971
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 8970, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8969
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8969, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8972
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8972, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8974
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8975
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__154, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8975, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 8975, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8974
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8977
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 8977, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8977, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 8977, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 8977, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8979
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8980
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 8980, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8980, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 8980, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8981
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8981, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8979
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8983
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8984
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":8983
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8986
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 8986, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 8986, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":8987
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8989
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":8972
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8961
 * 
 * 
 *     cdef __TreeSeries_float80_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8992
 * 
 * 
 *     cdef __TreeSeries_float80_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float80_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9000
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9000, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9001
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9000, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8999
 *         cdef object key
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8999, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9002
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9004
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9006
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_float80_t(node), other[key])
 *             __insert_node_float80_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9007
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float80_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float80_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9007, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9007, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float80_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9008
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float80_t(node), other[key])
 *             __insert_node_float80_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float80_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9008, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9004
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9010
 *             __insert_node_float80_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9012
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8992
 * 
 * 
 *     cdef __TreeSeries_float80_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float80_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9015
 * 
 * 
 *     cdef __TreeSeries_float80_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float80_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9021
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 9021, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9024
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9024, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9024, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9025
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9024, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9023
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_float80_t result
 *         result = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9023, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9027
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9028
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9029
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9030
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9031
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9031, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 9031, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9033
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9034
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9036
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9037
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float80_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9038
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float80_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9038, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9038, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9038, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 9038, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9038, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9038, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9038, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9038, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9039
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float80_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float80_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9039, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9040
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float80_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9042
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9043
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9045
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_float96_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9015
 * 
 * 
 *     cdef __TreeSeries_float80_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float80_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8450
 *     cdef arithmetic_type_float80_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 8450, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8451
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   float80_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 8451, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8452
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   float80_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":8453
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   float80_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 8453, __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("redblackpy.series.tree_series.__TreeSeries_float80_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 8453, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__155, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__156, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float80_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9059
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9063
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float96_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 9063, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_extrapolate == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9064, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)0.0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9063, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 9063, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 9064, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 9064, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9066
 *                    str interpolate="floor", float96_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9067
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9068
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9069
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9071
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9072
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9074
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9076
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9077
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__157, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9077, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 9077, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9076
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9074
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9080
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9081
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9081, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9080
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9084
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9084, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9063
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float96_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9091
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float96_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9091, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_5insert)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9091, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9091, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9091, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 9091, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9091, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9093
 *     cpdef void insert(self, key, float96_t value) except*:
 * 
 *         __insert_node_float96_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_float96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9093, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9091
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float96_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float96_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 9091, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 9091, __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_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_value == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9091, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9091, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9091, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9091, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9096
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9096, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9096, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9096, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9096, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9096, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9096, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9100
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float96_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 9100, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 9100, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9100, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9100, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9101
 * 
 *         for pair in pairs:
 *             __insert_node_float96_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9101, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9101, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9101, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9100
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float96_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9096
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 9096, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9096, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9096, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9104
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float96_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9104, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9104, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9104, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9104, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9104, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9104, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9106
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_float96_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_float96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9106, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9104
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float96_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9104, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9104, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9109
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9109, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9109, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9109, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9109, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9109, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9113
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_float96_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 9113, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 9113, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9114
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_float96_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9114, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_float96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9109
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 9109, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9109, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9109, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9117
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9117, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9117, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9117, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9120
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9122
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float96_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9123
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_float96_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9123, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 9123, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9122
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float96_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9125
 *             result.append( __deref_value_ptr_float96_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9117
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9117, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9128
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9128, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9128, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9128, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9128, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9131
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9131, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9133
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float96_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9134
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float96_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9135
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float96_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9134
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float96_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 9134, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9133
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float96_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9137
 *                              __deref_value_ptr_float96_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9128
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9128, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_18generator30(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":9140
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 9140, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_18generator30, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_float96_t_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 9140, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_18generator30(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9140, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9144
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float96_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9145
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float96_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9145, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9144
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float96_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9140
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9148
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9148, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9148, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9148, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9148, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9148, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9148, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9148, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9152
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9153
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9153, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9155
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9156
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__158);
    __pyx_r = __pyx_tuple__158;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9155
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9158
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float96_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9159
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_float96_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9159, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9158
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float96_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9158, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9148
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.floor", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9148, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9162
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9162, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9162, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9162, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9162, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9166
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9167
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9167, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9169
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9170
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__159);
    __pyx_r = __pyx_tuple__159;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9169
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9172
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float96_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9173
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_float96_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9173, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9172
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float96_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9162
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.ceil", __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_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9162, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9176
 * 
 * 
 *     cpdef __TreeSeries_float96_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9176, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9176, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9176, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9176, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9184
 *         cdef __TreeSeries_float96_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9185
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9188
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9188, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9188, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9189
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9188, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9187
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9187, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9191
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9191, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9192
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9192, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9193
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9194
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9196
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9197
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9196
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9199
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9196
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9201
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9201, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 9201, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9202
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9201
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9204
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float96_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9205
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_float96_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9206
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float96_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9205, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9208
 *                            __deref_value_ptr_float96_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9209
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9208
 *                            __deref_value_ptr_float96_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9211
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9213
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9176
 * 
 * 
 *     cpdef __TreeSeries_float96_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 9176, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 9176, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9176, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9176, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9216
 * 
 * 
 *     cpdef __TreeSeries_float96_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9216, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9216, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9216, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9216, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9216, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9219
 * 
 *         cdef __TreeSeries_float96_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9221
 *         cdef object it = start
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9221, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9222
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9221, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9220
 *         cdef __TreeSeries_float96_t result
 *         cdef object it = start
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9220, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9224
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9226
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9226, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 9226, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9227
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9227, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9227, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9227, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9227, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9227, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9227, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9227, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9227, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9228
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9228, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9230
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9232
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9216
 * 
 * 
 *     cpdef __TreeSeries_float96_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 9216, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 9216, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 9216, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9216, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9216, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9235
 * 
 * 
 *     cpdef __TreeSeries_float96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__160;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9235, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9235, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9235, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9235, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9235, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9242
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9242, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9242, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9243
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9242, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9241
 *         cdef tuple it
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9241, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9245
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 9245, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 9245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9245, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9246
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9246, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9246, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 9246, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 9246, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9246, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9246, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9246, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9248
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9235
 * 
 * 
 *     cpdef __TreeSeries_float96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__160;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 9235, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9235, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 9235, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 9236, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9235, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9251
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__161;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9251, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9251, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9251, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9251, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9256
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9257
 * 
 *         for it in deref(self.__index):
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9258
 *         for it in deref(self.__index):
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 9258, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9257
 * 
 *         for it in deref(self.__index):
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9258
 *         for it in deref(self.__index):
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 9258, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9257
 * 
 *         for it in deref(self.__index):
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9257, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_float96_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9257, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9256
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float96_t( it, method( __deref_value_ptr_float96_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9251
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__161;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 9251, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9251, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 9251, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 9252, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9251, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9251, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9261
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9261, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9261, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9261, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9261, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9261, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9263
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float96_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9263, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9263, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9264
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_float96_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9265
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float96_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9261
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float96_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 9261, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9261, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9268
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9268, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9268, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9268, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9268, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9268, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9270
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 9270, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9271
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9270
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9273
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 9273, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9274
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9273
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9268
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float96_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 9268, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9268, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9277
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9277, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9277, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9277, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9279
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9280
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9277
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float96_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9277, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9283
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9283, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9283, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9283, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9285
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9286
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9283
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float96_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9283, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9289
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9289, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9289, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9289, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9289, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9293
 *         cdef tuple it
 *         cdef float96_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9293, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9295
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 9295, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9297
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <float96_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9297, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 9297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9297, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9298
 * 
 *             for it in other.iteritems():
 *                 num = <float96_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9298, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 9298, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9299
 *             for it in other.iteritems():
 *                 num = <float96_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9299, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9299, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9295
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9301
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 9301, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9302
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9302, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 9302, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9302, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9303
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9303, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9303, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9303, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_13 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9303, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9303, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9301
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9306
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9306, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 9306, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9306, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9307
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9307, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9307, __pyx_L1_error)
      }
      __pyx_t_13 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9307, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9307, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9289
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 9289, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9289, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 9289, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9289, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9289, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9310
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9310, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9310, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9312
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9312, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 9312, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 9312, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9312, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9313
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9313, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9312
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9315
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9310
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9310, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9310, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9320
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9322
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9320
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9325
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9327
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9328
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9330
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9332
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 9332, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 9332, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9333
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 9333, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 9333, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9333, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9333, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9334
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9334, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 9334, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9334, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 9334, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9334, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 9334, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9333
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9332
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9337
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9337, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9337, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 9337, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9337, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9337, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9338
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9338, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 9338, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9338, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 9338, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9338, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 9338, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9337
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9340
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9342
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9342, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 9342, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9342, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 9342, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9343
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9343, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 9343, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9343, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 9343, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9343, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9343, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9342
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9345
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9325
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_float96_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9348
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9350
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9350, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9350, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9348
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_51generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":9353
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 9353, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_51generator31, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_float96_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 9353, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_51generator31(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9353, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9357
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float96_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9358
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_float96_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9358, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9358, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9357
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float96_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9353
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9361
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9363
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef float96_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9366
 *         cdef float96_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9367
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9367, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9366
 *         cdef float96_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9369
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9370
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9370, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9369
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9372
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9374
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9375
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9375, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9374
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9377
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9378
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 9378, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9377
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9380
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9381
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9381, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 9381, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9380
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9361
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9384
 * 
 * 
 *     def __setitem__(self, key, float96_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9384, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9386
 *     def __setitem__(self, key, float96_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9387
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9387, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9389
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float96_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9390
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_float96_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9390, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9389
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float96_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9393
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float96_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9393, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9393, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 9393, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9394
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_float96_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_float96_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9394, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9393
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float96_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9397
 * 
 *             else:
 *                 __insert_node_by_ptr_float96_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float96_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9397, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9384
 * 
 * 
 *     def __setitem__(self, key, float96_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9403
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float96_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9403, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9403, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9403, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9403, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9403, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9403, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9403, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9405
 *     cpdef __TreeSeries_float96_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_float96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_float96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9403
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float96_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 9403, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9403, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9408
 * 
 * 
 *     cpdef __TreeSeries_float96_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9408, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9408, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9408, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9408, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9408, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9408, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9410
 *     cpdef __TreeSeries_float96_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_float96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_float96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9410, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9408
 * 
 * 
 *     cpdef __TreeSeries_float96_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 9408, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9408, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9413
 * 
 * 
 *     cpdef __TreeSeries_float96_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9413, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9413, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9413, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9413, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9413, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9415
 *     cpdef __TreeSeries_float96_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_float96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_float96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9415, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9413
 * 
 * 
 *     cpdef __TreeSeries_float96_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 9413, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9413, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9418
 * 
 * 
 *     cpdef __TreeSeries_float96_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float96_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9418, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9418, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9418, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9418, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9418, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9418, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9418, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9420
 *     cpdef __TreeSeries_float96_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_float96_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_float96_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9418
 * 
 * 
 *     cpdef __TreeSeries_float96_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float96_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 9418, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9418, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9423
 * 
 * 
 *     cpdef __TreeSeries_float96_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9423, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9423, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9423, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9423, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9423, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9423, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9425
 *     cpdef __TreeSeries_float96_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9426
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 9426, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9425
 *     cpdef __TreeSeries_float96_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9423
 * 
 * 
 *     cpdef __TreeSeries_float96_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9423, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9429
 * 
 * 
 *     cpdef __TreeSeries_float96_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9429, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9429, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9429, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9429, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9429, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t))))) __PYX_ERR(3, 9429, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9431
 *     cpdef __TreeSeries_float96_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9432
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 9432, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9431
 *     cpdef __TreeSeries_float96_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9429
 * 
 * 
 *     cpdef __TreeSeries_float96_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9429, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9438
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9442
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 9442, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 9442, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9443
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__162, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 9443, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9442
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9445
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9445, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9445, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 9445, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9445, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 9445, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9445, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 9445, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 9445, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9446
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9446, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9446, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9446, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9446, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9445
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9438
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9449
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9451
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9451, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 9451, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9451, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 9451, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9451, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 9451, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9452
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0.0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9452, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9451
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9449
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9455
 * 
 * 
 *     cdef float96_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9458
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9461
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9461, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9462
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9464
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9465
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9464
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9468
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9470
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9455
 * 
 * 
 *     cdef float96_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float96_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9475
 * 
 * 
 *     cdef float96_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9477
 *     cdef float96_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9480
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9480, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9481
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9483
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9475
 * 
 * 
 *     cdef float96_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float96_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9488
 * 
 * 
 *     cdef __TreeSeries_float96_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9491
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float96_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9492
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9495
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9495, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9496
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9495, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9494
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9494, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9498
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9498, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9498, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9498, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 9498, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9499
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9498
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9501
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9503
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 9503, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9504
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9503
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9506
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 9506, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9507
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9506
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9501
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9509
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9509, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9510
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9510, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9511
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 9511, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9509
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9513
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9514
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9514, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9515
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 9515, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9513
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9517
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9518
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9517
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9520
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9517
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9522
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9523
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9522
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9525
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9525, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9526
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9527
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9527, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9526
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9526, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9525
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9530
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9531
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9531, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9532
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9530
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 9530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9488
 * 
 * 
 *     cdef __TreeSeries_float96_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9535
 * 
 * 
 *     cdef __TreeSeries_float96_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9538
 * 
 *         cdef __TreeSeries_float96_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9540
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9541
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9544
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9544, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9544, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9545
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9544, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9543
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9543, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9546
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9547
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__163, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9547, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 9547, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9546
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9549
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 9549, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 9549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9549, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9551
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9552
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9552, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9552, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9552, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9553
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9551
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9555
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9556
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9555
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9558
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9558, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 9558, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9559
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9561
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9535
 * 
 * 
 *     cdef __TreeSeries_float96_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9564
 * 
 * 
 *     cdef __TreeSeries_float96_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9567
 * 
 *         cdef __TreeSeries_float96_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9569
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9570
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9573
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9573, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9574
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9573, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9572
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9572, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9575
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9575, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9577
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9578
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__164, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 9578, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9577
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9580
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9580, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9580, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 9580, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9580, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9582
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":9583
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 9583, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9583, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9583, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":9584
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9584, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":9582
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9586
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":9587
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":9586
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9589
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9589, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 9589, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9590
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9592
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9575
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9564
 * 
 * 
 *     cdef __TreeSeries_float96_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9595
 * 
 * 
 *     cdef __TreeSeries_float96_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float96_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9603
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9603, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9604
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9603, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9602
 *         cdef object key
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9602, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9605
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9607
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9609
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_float96_t(node), other[key])
 *             __insert_node_float96_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9610
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float96_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float96_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9610, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float96_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9611
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float96_t(node), other[key])
 *             __insert_node_float96_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float96_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9611, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9607
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9613
 *             __insert_node_float96_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9615
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9595
 * 
 * 
 *     cdef __TreeSeries_float96_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float96_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9618
 * 
 * 
 *     cdef __TreeSeries_float96_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float96_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9624
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 9624, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9627
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9627, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9628
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9627, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9626
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_float96_t result
 *         result = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9626, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9630
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9631
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9632
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9633
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9634
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9634, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 9634, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9636
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9637
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9639
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9640
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float96_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9641
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float96_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9641, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9641, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9641, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 9641, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9641, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9641, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9641, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9642
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float96_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float96_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9642, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9643
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float96_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9645
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9646
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9648
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_float128_t(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9618
 * 
 * 
 *     cdef __TreeSeries_float96_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float96_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9053
 *     cdef arithmetic_type_float96_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 9053, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9054
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   float96_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 9054, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9055
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   float96_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9056
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   float96_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9056, __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("redblackpy.series.tree_series.__TreeSeries_float96_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9056, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__165, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__166, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float96_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9662
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9666
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float128_t extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 9666, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    if (values[4]) {
      __pyx_v_extrapolate = __pyx_PyFloat_AsDouble(values[4]); if (unlikely((__pyx_v_extrapolate == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9667, __pyx_L3_error)
    } else {
      __pyx_v_extrapolate = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)0.0);
    }
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9666, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 9666, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 9667, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 9667, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9669
 *                    str interpolate="floor", float128_t extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9670
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9671
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9672
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9674
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9675
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9677
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9679
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9680
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__167, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 9680, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9679
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9677
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9683
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9684
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9684, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9683
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9687
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9687, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9666
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", float128_t extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9694
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float128_t(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value, int __pyx_skip_dispatch) {
  __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;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9694, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_5insert)) {
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9694, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9694, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_v_key, __pyx_t_3};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9694, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 9694, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_key);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9694, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9696
 *     cpdef void insert(self, key, float128_t value) except*:
 * 
 *         __insert_node_float128_t(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_float128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9696, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9694
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, float128_t value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_float128_t(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 9694, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 9694, __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_value = __pyx_PyFloat_AsDouble(values[1]); if (unlikely((__pyx_v_value == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9694, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9694, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9694, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9694, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9699
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9699, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9699, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9699, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9699, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9699, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9699, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9703
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float128_t(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 9703, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 9703, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9703, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9703, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9704
 * 
 *         for pair in pairs:
 *             __insert_node_float128_t(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9704, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9704, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9704, __pyx_L1_error)
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_7); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9704, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9703
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_float128_t(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9699
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 9699, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9699, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9699, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9707
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float128_t(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9707, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9707, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9707, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9707, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9707, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9707, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9709
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_float128_t(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_float128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9709, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9707
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_float128_t(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9707, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9707, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9712
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9712, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9712, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9712, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9712, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9716
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_float128_t(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 9716, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 9716, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9717
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_float128_t(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9717, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_float128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9717, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9712
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 9712, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9712, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9712, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9720
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9720, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9720, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9720, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9723
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9725
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float128_t(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9726
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_float128_t(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9726, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 9726, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9725
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_float128_t(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9728
 *             result.append( __deref_value_ptr_float128_t(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9720
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9720, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9731
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9731, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9731, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9731, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9731, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9734
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9734, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9736
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float128_t(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9737
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float128_t(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9738
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float128_t(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_it)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9737
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_float128_t(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 9737, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9736
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_float128_t(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9740
 *                              __deref_value_ptr_float128_t(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9731
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9731, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_18generator32(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":9743
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 9743, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_18generator32, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_float128_t_iteritem, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 9743, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_18generator32(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9743, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9747
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float128_t(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9748
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float128_t(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9748, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9747
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_float128_t(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9743
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9751
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9751, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9751, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9751, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9751, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9751, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9751, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9751, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9755
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9756
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9756, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9758
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9759
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__168);
    __pyx_r = __pyx_tuple__168;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9758
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9761
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float128_t(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9762
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_float128_t(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_bounds.first)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9762, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9761
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float128_t(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9761, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9751
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.floor", __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_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9751, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9765
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9765, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9765, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9765, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9765, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9765, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9765, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9765, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9769
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9770
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9770, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9772
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9773
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__169);
    __pyx_r = __pyx_tuple__169;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9772
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9775
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float128_t(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9776
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_float128_t(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_bounds.second)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9775
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_float128_t(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9765
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.ceil", __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_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9765, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9779
 * 
 * 
 *     cpdef __TreeSeries_float128_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9779, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9779, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9779, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9779, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9779, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 9779, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9787
 *         cdef __TreeSeries_float128_t result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9788
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9791
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9791, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9791, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9792
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9791, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9790
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9790, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9794
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9794, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9795
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9795, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9796
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9797
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9799
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9800
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9799
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9802
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9799
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9804
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 9804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9805
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9804
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9807
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float128_t( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9808
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_float128_t( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9808, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9809
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_float128_t( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t((*__pyx_v_begin)), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9808, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9811
 *                            __deref_value_ptr_float128_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9812
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9811
 *                            __deref_value_ptr_float128_t( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9814
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9816
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9779
 * 
 * 
 *     cpdef __TreeSeries_float128_t truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 9779, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 9779, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9779, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9779, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9819
 * 
 * 
 *     cpdef __TreeSeries_float128_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_8;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9819, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9819, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9819, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 9819, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9822
 * 
 *         cdef __TreeSeries_float128_t result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9824
 *         cdef object it = start
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9824, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9825
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9824, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9823
 *         cdef __TreeSeries_float128_t result
 *         cdef object it = start
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9823, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9827
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9829
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9829, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 9829, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9830
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9830, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9830, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9830, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9830, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9830, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9831
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9833
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9835
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9819
 * 
 * 
 *     cpdef __TreeSeries_float128_t periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 9819, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 9819, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 9819, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9819, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9819, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9838
 * 
 * 
 *     cpdef __TreeSeries_float128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__170;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9838, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9838, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9838, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9838, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 9838, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9845
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9845, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 9845, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9846
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 9845, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9844
 *         cdef tuple it
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9844, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9848
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 9848, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9848, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 9848, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9848, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9849
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9849, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9849, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 9849, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 9849, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9849, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_10, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9849, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9851
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9838
 * 
 * 
 *     cpdef __TreeSeries_float128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__170;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 9838, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9838, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 9838, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 9839, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9838, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9854
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__171;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_10;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9854, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9854, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9854, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9854, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9854, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9859
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9860
 * 
 *         for it in deref(self.__index):
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_it)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9861
 *         for it in deref(self.__index):
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 9861, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9860
 * 
 *         for it in deref(self.__index):
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9861
 *         for it in deref(self.__index):
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 9861, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9860
 * 
 *         for it in deref(self.__index):
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9860, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_float128_t(__pyx_v_it, __pyx_t_10); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9860, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9859
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_float128_t( it, method( __deref_value_ptr_float128_t(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9854
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__171;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 9854, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9854, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 9854, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 9855, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9854, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9864
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9864, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9864, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9864, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9864, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9864, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9864, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9866
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float128_t[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9866, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9866, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9867
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_float128_t[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9868
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_float128_t[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9864
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float128_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 9864, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9864, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9871
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9871, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9871, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9871, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9871, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9871, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9871, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9873
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 9873, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9874
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9873
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9876
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 9876, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9877
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9876
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9871
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float128_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 9871, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9871, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9880
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9880, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9880, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9880, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9882
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9883
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9880
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float128_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9880, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9886
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*__pyx_t_5)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9886, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9886, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9888
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9889
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9886
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float128_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9886, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9892
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_num;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  double __pyx_t_12;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_13;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9892, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9892, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9892, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9892, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9896
 *         cdef tuple it
 *         cdef float128_t num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9896, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9898
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 9898, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9900
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <float128_t>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9900, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9900, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 9900, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9900, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9901
 * 
 *             for it in other.iteritems():
 *                 num = <float128_t>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9901, __pyx_L1_error)
      }
      __pyx_t_12 = __Pyx_PyObject_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(__pyx_t_12 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(3, 9901, __pyx_L1_error)
      __pyx_v_num = ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)__pyx_t_12);

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9902
 *             for it in other.iteritems():
 *                 num = <float128_t>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9902, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9902, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9898
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9904
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 9904, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9905
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9905, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9905, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 9905, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9905, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9906
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9906, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9906, __pyx_L1_error)
      }
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9906, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_13 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9906, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9906, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9904
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9909
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 9909, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 9909, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9909, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9910
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9910, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9910, __pyx_L1_error)
      }
      __pyx_t_13 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_13 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9910, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_13, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9910, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9892
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 9892, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 9892, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 9892, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9892, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9913
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9913, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9913, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9913, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9915
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9915, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 9915, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 9915, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9915, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9916
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9916, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9915
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9918
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9913
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9913, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9913, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9923
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9925
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9923
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9928
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9930
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9931
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9933
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9933, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9935
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 9935, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 9935, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9936
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 9936, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 9936, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9936, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9936, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9937
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9937, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 9937, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9937, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 9937, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9937, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 9937, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9936
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9935
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9940
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9940, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9940, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 9940, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9940, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 9940, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9941
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9941, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 9941, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9941, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 9941, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 9941, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 9941, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9940
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9943
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9945
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 9945, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9945, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 9945, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9945, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 9945, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9946
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 9946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9946, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 9946, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 9946, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 9946, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 9946, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9945
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9948
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9928
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_float128_t.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9951
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9953
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9953, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9953, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9951
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_51generator33(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":9956
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 9956, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_51generator33, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_float128_t___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 9956, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_51generator33(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9956, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9960
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float128_t(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9961
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_float128_t(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_cur_scope->__pyx_v_it)); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 9961, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9960
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_float128_t(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9956
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9964
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9966
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef float128_t result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9969
 *         cdef float128_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9970
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9969
 *         cdef float128_t result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9972
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_3 = (__pyx_t_1 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9973
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9973, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9972
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9975
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_v_result = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error));

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9977
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9978
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_result); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9978, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9977
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9980
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9981
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9981, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 9981, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9980
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9983
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_3 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9984
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9984, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 9984, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9983
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9964
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* 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_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9987
 * 
 * 
 *     def __setitem__(self, key, float128_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_arg_value) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  assert(__pyx_arg_value); {
    __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9987, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9989
 *     def __setitem__(self, key, float128_t value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9990
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 9990, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9992
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float128_t(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9993
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_float128_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9993, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":9992
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_float128_t(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9996
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float128_t(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 9996, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 9996, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 9996, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9997
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_float128_t(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_float128_t(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 9997, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":9996
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_float128_t(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10000
 * 
 *             else:
 *                 __insert_node_by_ptr_float128_t(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_float128_t(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10000, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9987
 * 
 * 
 *     def __setitem__(self, key, float128_t value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10006
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float128_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10006, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10006, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10006, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10006, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10006, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10006, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 10006, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10008
 *     cpdef __TreeSeries_float128_t add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_float128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_float128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10008, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10006
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_float128_t add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_float128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10006, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10006, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10011
 * 
 * 
 *     cpdef __TreeSeries_float128_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10011, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10011, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10011, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10011, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10011, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 10011, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10013
 *     cpdef __TreeSeries_float128_t sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_float128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_float128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10013, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10011
 * 
 * 
 *     cpdef __TreeSeries_float128_t sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_float128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10011, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10011, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10016
 * 
 * 
 *     cpdef __TreeSeries_float128_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10016, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10016, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10016, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10016, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10016, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10016, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 10016, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10018
 *     cpdef __TreeSeries_float128_t mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_float128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_float128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10018, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10016
 * 
 * 
 *     cpdef __TreeSeries_float128_t mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_float128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10016, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10016, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10021
 * 
 * 
 *     cpdef __TreeSeries_float128_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float128_t)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10021, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10021, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10021, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10021, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10021, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10021, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 10021, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10023
 *     cpdef __TreeSeries_float128_t div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_float128_t)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_float128_t)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10023, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10021
 * 
 * 
 *     cpdef __TreeSeries_float128_t div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_float128_t)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10021, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10021, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10026
 * 
 * 
 *     cpdef __TreeSeries_float128_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10026, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10026, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10026, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10026, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10026, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10026, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 10026, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10028
 *     cpdef __TreeSeries_float128_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10029
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 10029, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10029, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10028
 *     cpdef __TreeSeries_float128_t lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10026
 * 
 * 
 *     cpdef __TreeSeries_float128_t lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10026, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10032
 * 
 * 
 *     cpdef __TreeSeries_float128_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10032, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10032, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10032, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10032, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10032, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10032, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t))))) __PYX_ERR(3, 10032, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10034
 *     cpdef __TreeSeries_float128_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10035
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 10035, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10035, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10034
 *     cpdef __TreeSeries_float128_t rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10032
 * 
 * 
 *     cpdef __TreeSeries_float128_t rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10032, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10041
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_7;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10045
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 10045, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 10045, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10046
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__172, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10046, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 10046, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10045
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10048
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10048, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10048, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 10048, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10048, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 10048, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10048, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 10048, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 10048, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10049
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10049, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10049, __pyx_L1_error)
    }
    __pyx_t_7 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely((__pyx_t_7 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 10049, __pyx_L1_error)
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10049, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10048
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10041
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10052
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10054
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10054, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 10054, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 10054, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10054, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 10054, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10055
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, 0.0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10055, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10054
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10052
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10058
 * 
 * 
 *     cdef float128_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10061
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10064
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10064, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10065
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10067
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10068
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10067
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10071
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10073
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10058
 * 
 * 
 *     cdef float128_t __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float128_t.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10078
 * 
 * 
 *     cdef float128_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10080
 *     cdef float128_t __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10083
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10083, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10084
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10086
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_r = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_v_self->extrapolate, __pyx_v_error);
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10078
 * 
 * 
 *     cdef float128_t __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_float128_t.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10091
 * 
 * 
 *     cdef __TreeSeries_float128_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10094
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float128_t result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10095
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10098
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10098, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10098, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10099
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10098, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10097
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10097, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10101
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10101, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10101, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10101, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 10101, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10102
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10101
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10104
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10106
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10106, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10107
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10106
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10109
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10109, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10110
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10109
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10104
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10112
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10113
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10114
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 10114, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10112
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10116
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10116, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10117
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10118
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 10118, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10116
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10120
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10121
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10120
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10123
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10120
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10125
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10126
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10125
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10128
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10128, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10129
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10130
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10130, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10129
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10128
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10133
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10134
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10134, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10135
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10135, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10133
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 10133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10091
 * 
 * 
 *     cdef __TreeSeries_float128_t __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10138
 * 
 * 
 *     cdef __TreeSeries_float128_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10141
 * 
 *         cdef __TreeSeries_float128_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10143
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10144
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10147
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10147, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10148
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10147, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10146
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10146, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10149
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10150
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__173, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 10150, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10149
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10152
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 10152, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 10152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10152, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10154
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10155
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10155, __pyx_L1_error)
      }
      __pyx_t_8 = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_v_pair, 1)); if (unlikely((__pyx_t_8 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 10155, __pyx_L1_error)
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10155, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10156
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10154
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10158
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10159
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10158
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10161
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10161, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 10161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10162
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10164
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10138
 * 
 * 
 *     cdef __TreeSeries_float128_t __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10167
 * 
 * 
 *     cdef __TreeSeries_float128_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10170
 * 
 *         cdef __TreeSeries_float128_t result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10172
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10173
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10176
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10176, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10176, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10177
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10176, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10175
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10175, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10178
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10178, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10180
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10181
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__174, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 10181, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10180
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10183
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 10183, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10183, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 10183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10183, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10185
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10186
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 10186, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = __pyx_PyFloat_AsDouble(PyList_GET_ITEM(__pyx_v_delay_holder, 0)); if (unlikely((__pyx_t_9 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 10186, __pyx_L1_error)
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10186, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10187
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_1 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10187, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10185
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10189
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10190
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10189
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10192
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10192, __pyx_L1_error)
      }
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 10192, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10193
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10195
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10178
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10167
 * 
 * 
 *     cdef __TreeSeries_float128_t __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10198
 * 
 * 
 *     cdef __TreeSeries_float128_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float128_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_current;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_6;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10206
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10206, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10207
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10206, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10205
 *         cdef object key
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10205, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10208
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10210
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10212
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_float128_t(node), other[key])
 *             __insert_node_float128_t(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10213
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float128_t(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float128_t(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 10213, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_float128_t(__pyx_v_node), __pyx_t_6);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10214
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_float128_t(node), other[key])
 *             __insert_node_float128_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float128_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10214, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10210
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10216
 *             __insert_node_float128_t(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10218
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10198
 * 
 * 
 *     cdef __TreeSeries_float128_t __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_float128_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10221
 * 
 * 
 *     cdef __TreeSeries_float128_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float128_t action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t __pyx_v_action) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_v_current;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_10;
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_11;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10227
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 10227, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10230
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10230, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10230, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10231
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10230, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10229
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_float128_t result
 *         result = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10229, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10233
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10234
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10235
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10236
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10237
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10237, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 10237, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10239
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10240
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10242
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10243
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float128_t(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10244
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_float128_t(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10244, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10244, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 10244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10244, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 10244, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 10244, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_current = __pyx_v_action(__pyx_t_10, __pyx_t_11);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10245
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float128_t(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_float128_t(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10245, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10246
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_float128_t(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10248
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10249
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10251
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * @cython.internal
 * cdef class __TreeSeries_object(__BaseTreeSeries):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10221
 * 
 * 
 *     cdef __TreeSeries_float128_t __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_float128_t action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9656
 *     cdef arithmetic_type_float128_t __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 9656, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9657
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   float128_t extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 9657, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9658
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   float128_t extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":9659
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   float128_t extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 9659, __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("redblackpy.series.tree_series.__TreeSeries_float128_t.extrapolate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t __pyx_t_1;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (long double)-1) && PyErr_Occurred())) __PYX_ERR(3, 9659, __pyx_L1_error)
  __pyx_v_self->extrapolate = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.extrapolate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__175, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__176, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_float128_t.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10265
 * 
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<<
 *         pass
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object___init__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10269
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", object extrapolate=0, str arithmetic="left" ):
 * 
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_3__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  PyObject *__pyx_v_extrapolate = 0;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_Untitled);
    values[3] = ((PyObject*)__pyx_n_s_floor);
    values[4] = ((PyObject *)__pyx_int_0);
    values[5] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          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_ERR(3, 10269, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_name = ((PyObject*)values[2]);
    __pyx_v_interpolate = ((PyObject*)values[3]);
    __pyx_v_extrapolate = values[4];
    __pyx_v_arithmetic = ((PyObject*)values[5]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10269, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(3, 10269, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 10270, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 10270, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_2__cinit__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_2__cinit__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *(*__pyx_t_1)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10272
 *                    str interpolate="floor", object extrapolate=0, str arithmetic="left" ):
 * 
 *         self.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 *         self.extrapolate = extrapolate
 *         self.name = name
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolate, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10273
 * 
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.arithmetic = arithmetic
 */
  __Pyx_INCREF(__pyx_v_extrapolate);
  __Pyx_GIVEREF(__pyx_v_extrapolate);
  __Pyx_GOTREF(__pyx_v_self->extrapolate);
  __Pyx_DECREF(__pyx_v_self->extrapolate);
  __pyx_v_self->extrapolate = __pyx_v_extrapolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10274
 *         self.set_interpolation(interpolate)
 *         self.extrapolate = extrapolate
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.arithmetic = arithmetic
 * 
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10275
 *         self.extrapolate = extrapolate
 *         self.name = name
 *         self.arithmetic = arithmetic             # <<<<<<<<<<<<<<
 * 
 *         self.__get_item = self.__get_item_tree
 */
  __Pyx_INCREF(__pyx_v_arithmetic);
  __Pyx_GIVEREF(__pyx_v_arithmetic);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = __pyx_v_arithmetic;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10277
 *         self.arithmetic = arithmetic
 * 
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(arithmetic)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10278
 * 
 *         self.__get_item = self.__get_item_tree
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 *         if index is None:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10280
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
  __pyx_t_2 = (__pyx_v_index == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10282
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    __pyx_t_3 = (__pyx_v_values != Py_None);
    __pyx_t_2 = (__pyx_t_3 != 0);
    if (unlikely(__pyx_t_2)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10283
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__177, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10283, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_Raise(__pyx_t_4, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __PYX_ERR(3, 10283, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10282
 *         if index is None:
 * 
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 raise IndexError("Index cannot be None while values are not.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10280
 *         self.set_arithmetic(arithmetic)
 * 
 *         if index is None:             # <<<<<<<<<<<<<<
 * 
 *             if values is not None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10286
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
  /*else*/ {
    __pyx_t_2 = (__pyx_v_values != Py_None);
    __pyx_t_3 = (__pyx_t_2 != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10287
 *         else:
 *             if values is not None:
 *                 self.__init_tree(index, values)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree(__pyx_v_self, __pyx_v_index, __pyx_v_values); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10287, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10286
 * 
 *         else:
 *             if values is not None:             # <<<<<<<<<<<<<<
 *                 self.__init_tree(index, values)
 * 
 */
      goto __pyx_L5;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10290
 * 
 *             else:
 *                 self.__init_tree_index(index)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___init_tree_index(__pyx_v_self, __pyx_v_index); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10290, __pyx_L1_error)
    }
    __pyx_L5:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10269
 * 
 * 
 *     def __cinit__( self, object index=None, object values=None, str name="Untitled",             # <<<<<<<<<<<<<<
 *                    str interpolate="floor", object extrapolate=0, str arithmetic="left" ):
 * 
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10297
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, object value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_object(self.__index, key, value)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10297, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_5insert)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_value};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10297, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_value};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10297, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10297, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10297, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10299
 *     cpdef void insert(self, key, object value) except*:
 * 
 *         __insert_node_object(self.__index, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___insert_node_object(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10299, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10297
 *     #--------------------------------------------------------------------------------------------
 * 
 *     cpdef void insert(self, key, object value) except*:             # <<<<<<<<<<<<<<
 * 
 *         __insert_node_object(self.__index, key, value)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_5insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(3, 10297, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(3, 10297, __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_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10297, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4insert(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4insert(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10297, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10297, __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("redblackpy.series.tree_series.__TreeSeries_object.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10302
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pair = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10302, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_7insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10302, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10302, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10302, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10302, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10306
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_object(self.__index, pair[0], pair[1])
 * 
 */
  if (unlikely(__pyx_v_pairs == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 10306, __pyx_L1_error)
  }
  __pyx_t_1 = __pyx_v_pairs; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
  for (;;) {
    if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_2); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(3, 10306, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10306, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10306, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10307
 * 
 *         for pair in pairs:
 *             __insert_node_object(self.__index, pair[0], pair[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10307, __pyx_L1_error)
    }
    __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_2);
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10307, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
    __Pyx_INCREF(__pyx_t_3);
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_object(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_2, __pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10306
 *         cdef tuple pair
 * 
 *         for pair in pairs:             # <<<<<<<<<<<<<<
 *             __insert_node_object(self.__index, pair[0], pair[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10302
 * 
 * 
 *     cpdef void insert_range(self, list pairs) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple pair
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_7insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_pairs), (&PyList_Type), 1, "pairs", 1))) __PYX_ERR(3, 10302, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_6insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject*)__pyx_v_pairs));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_6insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10302, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10302, __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("redblackpy.series.tree_series.__TreeSeries_object.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10310
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_object(self.__index, key)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10310, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_9erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10310, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10310, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10310, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10310, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10310, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10312
 *     cpdef void erase(self, key) except*:
 * 
 *         __erase_node_object(self.__index, key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series___erase_node_object(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_key); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10312, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10310
 * 
 * 
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 * 
 *         __erase_node_object(self.__index, key)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_9erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_8erase(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_8erase(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10310, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10310, __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("redblackpy.series.tree_series.__TreeSeries_object.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10315
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_keys, int __pyx_skip_dispatch) {
  Py_ssize_t __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("erase_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10315, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11erase_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10315, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10315, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_keys};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10315, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_keys);
          __Pyx_GIVEREF(__pyx_v_keys);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_keys);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10315, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10319
 *         cdef Py_ssize_t it
 * 
 *         for it in range( len(keys) ):             # <<<<<<<<<<<<<<
 *             __erase_node_object(self.__index, keys[it])
 * 
 */
  if (unlikely(__pyx_v_keys == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 10319, __pyx_L1_error)
  }
  __pyx_t_6 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(3, 10319, __pyx_L1_error)
  __pyx_t_7 = __pyx_t_6;
  for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
    __pyx_v_it = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10320
 * 
 *         for it in range( len(keys) ):
 *             __erase_node_object(self.__index, keys[it])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_keys == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10320, __pyx_L1_error)
    }
    __pyx_t_1 = PyList_GET_ITEM(__pyx_v_keys, __pyx_v_it);
    __Pyx_INCREF(__pyx_t_1);
    __pyx_f_10redblackpy_6series_11tree_series___erase_node_object(__pyx_v_self->__pyx_base.__pyx___index, __pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10320, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10315
 * 
 * 
 *     cpdef void erase_range(self, list keys) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef Py_ssize_t it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11erase_range(PyObject *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase_range (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_keys), (&PyList_Type), 1, "keys", 1))) __PYX_ERR(3, 10315, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10erase_range(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject*)__pyx_v_keys));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10erase_range(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_keys) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase_range(__pyx_v_self, __pyx_v_keys, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10315, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10315, __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("redblackpy.series.tree_series.__TreeSeries_object.erase_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10323
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10323, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_13values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10323, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10323, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10323, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10326
 * 
 *         cdef rb_node_valued* it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10328
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_object(it) )
 * 
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10329
 * 
 *         for it in deref(self.__index):
 *             result.append( __deref_value_ptr_object(it) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_1); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 10329, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10328
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( __deref_value_ptr_object(it) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10331
 *             result.append( __deref_value_ptr_object(it) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10323
 * 
 * 
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef rb_node_valued* it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_13values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_12values(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_12values(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10323, __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("redblackpy.series.tree_series.__TreeSeries_object.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10334
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  PyObject *__pyx_v_result = 0;
  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;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_5;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10334, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_15items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10334, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10334, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10334, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10337
 * 
 *         cdef node_ptr it
 *         cdef list result = []             # <<<<<<<<<<<<<<
 * 
 *         for it in deref(self.__index):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_result = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10339
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_object(it) ) )
 */
  __pyx_t_6 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_5 = __pyx_t_6->begin();
  for (;;) {
    if (!(__pyx_t_5 != __pyx_t_6->end())) break;
    __pyx_t_7 = *__pyx_t_5;
    ++__pyx_t_5;
    __pyx_v_it = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10340
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_object(it) ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10341
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_object(it) ) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10340
 * 
 *         for it in deref(self.__index):
 *             result.append( ( self.__get_key_from_ptr(it),             # <<<<<<<<<<<<<<
 *                              __deref_value_ptr_object(it) ) )
 * 
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_t_8 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(3, 10340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10339
 *         cdef list result = []
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             result.append( ( self.__get_key_from_ptr(it),
 *                              __deref_value_ptr_object(it) ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10343
 *                              __deref_value_ptr_object(it) ) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10334
 * 
 * 
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_15items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_14items(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_14items(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10334, __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("redblackpy.series.tree_series.__TreeSeries_object.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_object_18generator34(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":10346
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_17iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_16iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_16iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 10346, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_object_18generator34, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iteritems, __pyx_n_s_TreeSeries_object_iteritems, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 10346, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_object_18generator34(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 10346, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10350
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_object(it) )
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10351
 * 
 *         for it in deref(self.__index):
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_object(it) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_cur_scope->__pyx_v_self), __pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10351, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_6;
    __pyx_t_6 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 10351, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10350
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield ( self.__get_key_from_ptr(it), __deref_value_ptr_object(it) )
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10346
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10354
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_20floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10354, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10354, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10354, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10354, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10354, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10354, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10358
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10359
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10359, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10361
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10362
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__178);
    __pyx_r = __pyx_tuple__178;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10361
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.first == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10364
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_object(bounds.first) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.first); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10365
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 *                  __deref_value_ptr_object(bounds.first) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_bounds.first); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10364
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_object(bounds.first) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10354
 * 
 * 
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.floor", __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_10redblackpy_6series_11tree_series_19__TreeSeries_object_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_20floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_19floor(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_19floor(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10354, __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("redblackpy.series.tree_series.__TreeSeries_object.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10368
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_6;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10368, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_22ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10368, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10368, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10368, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10368, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10368, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10372
 *         cdef pair[node_ptr, node_ptr] bounds
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         bounds = self.__index.tree_search(c_key)
 * 
 */
  __pyx_t_6.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10373
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 * 
 *         if bounds.second == self.link():
 */
  try {
    __pyx_t_7 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10373, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10375
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  __pyx_t_8 = ((__pyx_v_bounds.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10376
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_tuple__179);
    __pyx_r = __pyx_tuple__179;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10375
 *         bounds = self.__index.tree_search(c_key)
 * 
 *         if bounds.second == self.link():             # <<<<<<<<<<<<<<
 *             return (None, None)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10378
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_object(bounds.second) )
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_bounds.second); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10379
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 *                  __deref_value_ptr_object(bounds.second) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_bounds.second); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10379, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10378
 *             return (None, None)
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),             # <<<<<<<<<<<<<<
 *                  __deref_value_ptr_object(bounds.second) )
 * 
 */
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10368
 * 
 * 
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef pair[node_ptr, node_ptr] bounds
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.ceil", __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_10redblackpy_6series_11tree_series_19__TreeSeries_object_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_22ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_21ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_21ceil(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10368, __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("redblackpy.series.tree_series.__TreeSeries_object.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10382
 * 
 * 
 *     cpdef __TreeSeries_object truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_iterator __pyx_v_end;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_start;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_start;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_stop;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_node_valued<__pyx_t_10redblackpy_6series_11tree_series_c_pyobject,__pyx_t_10redblackpy_6series_11tree_series_void_ptr> ::iterator __pyx_t_9;
  int __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10382, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_24truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10382, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10382, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10382, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10382, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10382, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10390
 *         cdef __TreeSeries_object result
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)             # <<<<<<<<<<<<<<
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_start);
  __pyx_v_c_start = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10391
 *         #bug? cython 0.28.3 declare c_key as const, if do not declare it directly
 *         cdef c_pyobject c_start = c_pyobject(<PyObject*>start)
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 */
  __pyx_t_7.data = ((PyObject *)__pyx_v_stop);
  __pyx_v_c_stop = __pyx_t_7;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10394
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10394, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10395
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10394, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10393
 *         cdef c_pyobject c_stop = c_pyobject(<PyObject*>stop)
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10393, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10397
 *                                                arithmetic=self.arithmetic )
 * 
 *         bounds_start = self.__index.tree_search(c_start)             # <<<<<<<<<<<<<<
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_start);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10397, __pyx_L1_error)
  }
  __pyx_v_bounds_start = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10398
 * 
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)             # <<<<<<<<<<<<<<
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position
 */
  try {
    __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_stop);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10398, __pyx_L1_error)
  }
  __pyx_v_bounds_end = __pyx_t_8;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10399
 *         bounds_start = self.__index.tree_search(c_start)
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position             # <<<<<<<<<<<<<<
 *         end = deref(bounds_end.first).it_position
 * 
 */
  __pyx_t_9 = (*__pyx_v_bounds_start.second).it_position;
  __pyx_v_begin = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10400
 *         bounds_end = self.__index.tree_search(c_stop)
 *         begin = deref(bounds_start.second).it_position
 *         end = deref(bounds_end.first).it_position             # <<<<<<<<<<<<<<
 * 
 *         if( bounds_start.second == self.link() ) \
 */
  __pyx_t_9 = (*__pyx_v_bounds_end.first).it_position;
  __pyx_v_end = __pyx_t_9;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10402
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  __pyx_t_11 = ((__pyx_v_bounds_start.second == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_11) {
  } else {
    __pyx_t_10 = __pyx_t_11;
    goto __pyx_L4_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10403
 * 
 *         if( bounds_start.second == self.link() ) \
 *             or ( bounds_end.first == self.link() ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_11 = ((__pyx_v_bounds_end.first == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_10 = __pyx_t_11;
  __pyx_L4_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10402
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10405
 *             or ( bounds_end.first == self.link() ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10402
 *         end = deref(bounds_end.first).it_position
 * 
 *         if( bounds_start.second == self.link() ) \             # <<<<<<<<<<<<<<
 *             or ( bounds_end.first == self.link() ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10407
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10407, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(3, 10407, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_10) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10408
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         while True:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10407
 *             return result
 * 
 *         if self.__get_key_from_iter(begin) > self.__get_key_from_iter(end):             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10410
 *             return result
 * 
 *         while True:             # <<<<<<<<<<<<<<
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_object( deref(begin) ) )
 */
  while (1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10411
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_object( deref(begin) ) )
 * 
 */
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10411, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10412
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),
 *                            __deref_value_ptr_object( deref(begin) ) )             # <<<<<<<<<<<<<<
 * 
 *             if begin == end:
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object((*__pyx_v_begin)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10412, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10411
 * 
 *         while True:
 *             result.insert( self.__get_key_from_iter(begin),             # <<<<<<<<<<<<<<
 *                            __deref_value_ptr_object( deref(begin) ) )
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_3, __pyx_t_1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10411, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10414
 *                            __deref_value_ptr_object( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    __pyx_t_10 = ((__pyx_v_begin == __pyx_v_end) != 0);
    if (__pyx_t_10) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10415
 * 
 *             if begin == end:
 *                 break             # <<<<<<<<<<<<<<
 * 
 *             inc(begin)
 */
      goto __pyx_L8_break;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10414
 *                            __deref_value_ptr_object( deref(begin) ) )
 * 
 *             if begin == end:             # <<<<<<<<<<<<<<
 *                 break
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10417
 *                 break
 * 
 *             inc(begin)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    (void)((++__pyx_v_begin));
  }
  __pyx_L8_break:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10419
 *             inc(begin)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10382
 * 
 * 
 *     cpdef __TreeSeries_object truncate(self, start, stop):             # <<<<<<<<<<<<<<
 * 
 *         cdef iterator begin
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_24truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(3, 10382, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(3, 10382, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10382, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_23truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_23truncate(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10382, __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("redblackpy.series.tree_series.__TreeSeries_object.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10422
 * 
 * 
 *     cpdef __TreeSeries_object periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("periodic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10422, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_26periodic)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10422, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10422, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10422, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10422, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10425
 * 
 *         cdef __TreeSeries_object result
 *         cdef object it = start             # <<<<<<<<<<<<<<
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 */
  __Pyx_INCREF(__pyx_v_start);
  __pyx_v_it = __pyx_v_start;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10427
 *         cdef object it = start
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10427, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10428
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10427, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10426
 *         cdef __TreeSeries_object result
 *         cdef object it = start
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10426, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10430
 *                                                arithmetic=self.arithmetic )
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while it < stop:
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10432
 *         self.on_itermode()
 * 
 *         while it < stop:             # <<<<<<<<<<<<<<
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step
 */
  while (1) {
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_it, __pyx_v_stop, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10432, __pyx_L1_error)
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 10432, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (!__pyx_t_7) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10433
 * 
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )             # <<<<<<<<<<<<<<
 *             it = it + step
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    if (!__pyx_t_3) {
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_it); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10433, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_it};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10433, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10433, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
        __Pyx_INCREF(__pyx_v_it);
        __Pyx_GIVEREF(__pyx_v_it);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_it);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10433, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_v_it, __pyx_t_2, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10434
 *         while it < stop:
 *             result.insert( it, self.__getitem__(it) )
 *             it = it + step             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    __pyx_t_2 = PyNumber_Add(__pyx_v_it, __pyx_v_step); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_it, __pyx_t_2);
    __pyx_t_2 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10436
 *             it = it + step
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10438
 *         self.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10422
 * 
 * 
 *     cpdef __TreeSeries_object periodic(self, start, stop, step):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_26periodic(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("periodic (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 1); __PYX_ERR(3, 10422, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, 2); __PYX_ERR(3, 10422, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "periodic") < 0)) __PYX_ERR(3, 10422, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("periodic", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10422, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_25periodic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_25periodic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("periodic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_periodic(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10422, __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("redblackpy.series.tree_series.__TreeSeries_object.periodic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10441
 * 
 * 
 *     cpdef __TreeSeries_object map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__180;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_28map)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10441, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10441, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10441, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10441, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10441, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10448
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10448, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10449
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         for it in self.iteritems():
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10448, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10447
 *         cdef tuple it
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10447, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10451
 *                                                arithmetic=self.arithmetic )
 * 
 *         for it in self.iteritems():             # <<<<<<<<<<<<<<
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 */
  __pyx_t_7 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 10451, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_8), (&__pyx_t_5)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_9 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_7, NULL, NULL, &__pyx_t_1, __pyx_t_5);
    if (unlikely(__pyx_t_9 == 0)) break;
    if (unlikely(__pyx_t_9 == -1)) __PYX_ERR(3, 10451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10451, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10452
 * 
 *         for it in self.iteritems():
 *             result.insert( it[0], method(it[1], *args, **kwargs) )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10452, __pyx_L1_error)
    }
    __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_1);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10452, __pyx_L1_error)
    }
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    __Pyx_GIVEREF(PyTuple_GET_ITEM(__pyx_v_it, 1));
    PyTuple_SET_ITEM(__pyx_t_3, 0, PyTuple_GET_ITEM(__pyx_v_it, 1));
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 10452, __pyx_L1_error)
    }
    __pyx_t_6 = PyNumber_Add(__pyx_t_3, __pyx_v_args); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 10452, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_6, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10452, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_3, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10452, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10454
 *             result.insert( it[0], method(it[1], *args, **kwargs) )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10441
 * 
 * 
 *     cpdef __TreeSeries_object map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_28map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__180;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(3, 10441, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10441, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 10441, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 10442, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_27map(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_27map(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 2;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = ((PyObject *)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10441, __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("redblackpy.series.tree_series.__TreeSeries_object.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10457
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace *__pyx_optional_args) {
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__181;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_it;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_7;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_8;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_9;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_args = __pyx_optional_args->args;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_kwargs = __pyx_optional_args->kwargs;
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10457, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_30map_inplace)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10457, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10457, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10457, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_method);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_kwargs);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10457, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10462
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_object( it, method( __deref_value_ptr_object(it),
 *                                              *args, **kwargs ) )
 */
  __pyx_t_8 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_7 = __pyx_t_8->begin();
  for (;;) {
    if (!(__pyx_t_7 != __pyx_t_8->end())) break;
    __pyx_t_9 = *__pyx_t_7;
    ++__pyx_t_7;
    __pyx_v_it = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10463
 * 
 *         for it in deref(self.__index):
 *             __set_value_object( it, method( __deref_value_ptr_object(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_it); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10464
 *         for it in deref(self.__index):
 *             __set_value_object( it, method( __deref_value_ptr_object(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_args == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 10464, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10463
 * 
 *         for it in deref(self.__index):
 *             __set_value_object( it, method( __deref_value_ptr_object(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_args); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10464
 *         for it in deref(self.__index):
 *             __set_value_object( it, method( __deref_value_ptr_object(it),
 *                                              *args, **kwargs ) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_kwargs == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "argument after ** must be a mapping, not NoneType");
      __PYX_ERR(3, 10464, __pyx_L1_error)
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10463
 * 
 *         for it in deref(self.__index):
 *             __set_value_object( it, method( __deref_value_ptr_object(it),             # <<<<<<<<<<<<<<
 *                                              *args, **kwargs ) )
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_method, __pyx_t_1, __pyx_v_kwargs); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_f_10redblackpy_6series_11tree_series___set_value_object(__pyx_v_it, __pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10463, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10462
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             __set_value_object( it, method( __deref_value_ptr_object(it),
 *                                              *args, **kwargs ) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10457
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_30map_inplace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map_inplace (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[3] = {0,0,0};
    values[1] = ((PyObject*)__pyx_empty_tuple);
    values[2] = __pyx_k__181;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map_inplace") < 0)) __PYX_ERR(3, 10457, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    __pyx_v_args = ((PyObject*)values[1]);
    __pyx_v_kwargs = ((PyObject*)values[2]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map_inplace", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10457, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(3, 10457, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(3, 10458, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_29map_inplace(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_method, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_29map_inplace(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_method, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("map_inplace", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 2;
  __pyx_t_1.args = __pyx_v_args;
  __pyx_t_1.kwargs = __pyx_v_kwargs;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object->map_inplace(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10457, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.map_inplace", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10467
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  std::string __pyx_v_c_interpolate;
  __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;
  std::string __pyx_t_6;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_32set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10467, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10467, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10467, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10469
 *     cpdef void set_interpolation(self, str interpolate):
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')             # <<<<<<<<<<<<<<
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_object[c_interpolate]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_interpolate);
  __Pyx_INCREF(__pyx_n_s_utf8);
  __Pyx_GIVEREF(__pyx_n_s_utf8);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_utf8);
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&PyByteArray_Type)), __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_convert_string_from_py_std__in_string(__pyx_t_2); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10469, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_c_interpolate = __pyx_t_6;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10470
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate             # <<<<<<<<<<<<<<
 *         self.__interpolate = __INTERPOLATE_object[c_interpolate]
 * 
 */
  __Pyx_INCREF(__pyx_v_interpolate);
  __Pyx_GIVEREF(__pyx_v_interpolate);
  __Pyx_GOTREF(__pyx_v_self->interpolate_type);
  __Pyx_DECREF(__pyx_v_self->interpolate_type);
  __pyx_v_self->interpolate_type = __pyx_v_interpolate;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10471
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 *         self.interpolate_type = interpolate
 *         self.__interpolate = __INTERPOLATE_object[c_interpolate]             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_v_self->__pyx___interpolate = (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object[__pyx_v_c_interpolate]);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10467
 * 
 * 
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 * 
 *         cdef string c_interpolate = bytearray(interpolate, 'utf8')
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_object.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_32set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(3, 10467, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_31set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_31set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10467, __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("redblackpy.series.tree_series.__TreeSeries_object.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10474
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx_t_8)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object);
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*__pyx_t_9)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object);
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10474, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_34set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10474, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10474, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10474, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10474, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10474, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10476
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_union, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 10476, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10477
 * 
 *         if arithmetic == "union":
 *             self.__arithmetic = self.__arithmetic_union             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "left":
 */
    __pyx_t_8 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_union;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_8;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10476
 *     cpdef void set_arithmetic(self, str arithmetic):
 * 
 *         if arithmetic == "union":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_union
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10479
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_arithmetic, __pyx_n_s_left, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 10479, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_7 != 0);
  if (__pyx_t_6) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10480
 * 
 *         if arithmetic == "left":
 *             self.__arithmetic = self.__arithmetic_left             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_9 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___arithmetic_left;
    __pyx_v_self->__pyx___arithmetic = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10479
 *             self.__arithmetic = self.__arithmetic_union
 * 
 *         if arithmetic == "left":             # <<<<<<<<<<<<<<
 *             self.__arithmetic = self.__arithmetic_left
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10474
 * 
 * 
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         if arithmetic == "union":
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_object.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_34set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(3, 10474, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_33set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_33set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10474, __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("redblackpy.series.tree_series.__TreeSeries_object.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10483
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch) {
  __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)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10483, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_36on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10483, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10483, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10485
 *     cpdef void on_itermode(self):
 * 
 *         __BaseTreeSeries.on_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_linear
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10486
 * 
 *         __BaseTreeSeries.on_itermode(self)
 *         self.__get_item = self.__get_item_linear             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_linear;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10483
 * 
 * 
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.on_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_object.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_36on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_35on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_35on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10483, __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("redblackpy.series.tree_series.__TreeSeries_object.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10489
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch) {
  __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)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *);
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10489, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_38off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10489, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10489, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10491
 *     cpdef void off_itermode(self):
 * 
 *         __BaseTreeSeries.off_itermode(self)             # <<<<<<<<<<<<<<
 *         self.__get_item = self.__get_item_tree
 * 
 */
  __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 1);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10492
 * 
 *         __BaseTreeSeries.off_itermode(self)
 *         self.__get_item = self.__get_item_tree             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_5 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_tree;
  __pyx_v_self->__pyx___get_item = __pyx_t_5;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10489
 * 
 * 
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 * 
 *         __BaseTreeSeries.off_itermode(self)
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.__TreeSeries_object.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_38off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_37off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_37off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10489, __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("redblackpy.series.tree_series.__TreeSeries_object.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10495
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data *__pyx_optional_args) {
  PyObject *__pyx_v_to_type = ((PyObject*)__pyx_n_s_numerical);
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_num = 0;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("copy_data", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_to_type = __pyx_optional_args->to_type;
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10495, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_40copy_data)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10495, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_other, __pyx_v_to_type};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10495, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_other);
        __Pyx_GIVEREF(__pyx_v_other);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_other);
        __Pyx_INCREF(__pyx_v_to_type);
        __Pyx_GIVEREF(__pyx_v_to_type);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_to_type);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10495, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10499
 *         cdef tuple it
 *         cdef object num
 *         self.clear()             # <<<<<<<<<<<<<<
 * 
 *         if to_type == "numerical":
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->clear(__pyx_v_self, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10499, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10501
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
  __pyx_t_7 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_numerical, Py_EQ)); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(3, 10501, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  if (__pyx_t_8) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10503
 *         if to_type == "numerical":
 * 
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 num = <object>float(it[1])
 *                 self.insert( it[0], num )
 */
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 10503, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10503, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 10503, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10503, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10504
 * 
 *             for it in other.iteritems():
 *                 num = <object>float(it[1])             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], num )
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10504, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyNumber_Float(PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10504, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = __pyx_t_2;
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_num, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10505
 *             for it in other.iteritems():
 *                 num = <object>float(it[1])
 *                 self.insert( it[0], num )             # <<<<<<<<<<<<<<
 * 
 *         elif to_type == "str":
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10505, __pyx_L1_error)
      }
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_3);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_3, __pyx_v_num, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10505, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10501
 *         self.clear()
 * 
 *         if to_type == "numerical":             # <<<<<<<<<<<<<<
 * 
 *             for it in other.iteritems():
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10507
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
  __pyx_t_8 = (__Pyx_PyString_Equals(__pyx_v_to_type, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(3, 10507, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_8 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10508
 * 
 *         elif to_type == "str":
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert( it[0], str(it[1]) )
 * 
 */
    __pyx_t_10 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 10508, __pyx_L1_error)
    }
    __pyx_t_3 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_9), (&__pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10508, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_9, &__pyx_t_10, NULL, NULL, &__pyx_t_3, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 10508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 10508, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_3));
      __pyx_t_3 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10509
 *         elif to_type == "str":
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10509, __pyx_L1_error)
      }
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_3);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10509, __pyx_L1_error)
      }
      __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), PyTuple_GET_ITEM(__pyx_v_it, 1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_3, __pyx_t_2, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10509, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10507
 *                 self.insert( it[0], num )
 * 
 *         elif to_type == "str":             # <<<<<<<<<<<<<<
 *             for it in other.iteritems():
 *                 self.insert( it[0], str(it[1]) )
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10512
 * 
 *         else:
 *             for it in other.iteritems():             # <<<<<<<<<<<<<<
 *                 self.insert(it[0], it[1])
 * 
 */
  /*else*/ {
    __pyx_t_9 = 0;
    if (unlikely(__pyx_v_other == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 10512, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_dict_iterator(__pyx_v_other, 0, __pyx_n_s_iteritems, (&__pyx_t_10), (&__pyx_t_5)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10512, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_2;
    __pyx_t_2 = 0;
    while (1) {
      __pyx_t_11 = __Pyx_dict_iter_next(__pyx_t_1, __pyx_t_10, &__pyx_t_9, NULL, NULL, &__pyx_t_2, __pyx_t_5);
      if (unlikely(__pyx_t_11 == 0)) break;
      if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(3, 10512, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10512, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10513
 *         else:
 *             for it in other.iteritems():
 *                 self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10513, __pyx_L1_error)
      }
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_v_it, 0);
      __Pyx_INCREF(__pyx_t_2);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10513, __pyx_L1_error)
      }
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_v_it, 1);
      __Pyx_INCREF(__pyx_t_3);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_2, __pyx_t_3, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10513, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10495
 * 
 * 
 *     cpdef void copy_data(self, other, str to_type="numerical") except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_num);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_40copy_data(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_other = 0;
  PyObject *__pyx_v_to_type = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("copy_data (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_other,&__pyx_n_s_to_type,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject*)__pyx_n_s_numerical);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_other)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_to_type);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "copy_data") < 0)) __PYX_ERR(3, 10495, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_other = values[0];
    __pyx_v_to_type = ((PyObject*)values[1]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("copy_data", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 10495, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_to_type), (&PyString_Type), 1, "to_type", 1))) __PYX_ERR(3, 10495, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_39copy_data(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), __pyx_v_other, __pyx_v_to_type);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_39copy_data(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_other, PyObject *__pyx_v_to_type) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("copy_data", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1.__pyx_n = 1;
  __pyx_t_1.to_type = __pyx_v_to_type;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object->copy_data(__pyx_v_self, __pyx_v_other, 1, &__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10495, __pyx_L1_error)
  __pyx_t_2 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.copy_data", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10516
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_key = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  __Pyx_RefNannySetupContext("clear", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_clear); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10516, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_42clear)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10516, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10516, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10518
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.keys(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10518, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__pyx_t_1 == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
    __PYX_ERR(3, 10518, __pyx_L1_error)
  }
  __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(3, 10518, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10518, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10519
 * 
 *         for key in self.keys():
 *             self.erase(key)             # <<<<<<<<<<<<<<
 * 
 *         self.__index.clear()
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->erase(__pyx_v_self, __pyx_v_key, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10519, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10518
 *     cpdef void clear(self) except*:
 * 
 *         for key in self.keys():             # <<<<<<<<<<<<<<
 *             self.erase(key)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10521
 *             self.erase(key)
 * 
 *         self.__index.clear()             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __pyx_v_self->__pyx_base.__pyx___index->clear();

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10516
 * 
 * 
 *     cpdef void clear(self) except*:             # <<<<<<<<<<<<<<
 * 
 *         for key in self.keys():
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_42clear(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("clear (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_41clear(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_41clear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("clear", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_clear(__pyx_v_self, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10516, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10516, __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("redblackpy.series.tree_series.__TreeSeries_object.clear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10526
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

/* Python wrapper */
static void __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_44__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_44__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_43__dealloc__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_43__dealloc__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10528
 *     def __dealloc__(self):
 * 
 *         del self.__index             # <<<<<<<<<<<<<<
 * 
 * 
 */
  delete __pyx_v_self->__pyx_base.__pyx___index;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10526
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 * 
 *         del self.__index
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10531
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\n'
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_46__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_46__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_45__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_45__str__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_v_out_format = 0;
  PyObject *__pyx_v_result = 0;
  PyObject *__pyx_v_it = 0;
  PyObject *__pyx_v_items = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10533
 *     def __str__(self):
 * 
 *         cdef str out_format = '{key}: {value}\n'             # <<<<<<<<<<<<<<
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 */
  __Pyx_INCREF(__pyx_kp_s_key_value);
  __pyx_v_out_format = __pyx_kp_s_key_value;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10534
 * 
 *         cdef str out_format = '{key}: {value}\n'
 *         cdef str result = 'Series object ' + self.name + '\n'             # <<<<<<<<<<<<<<
 *         cdef tuple it
 *         cdef list items = self.items()
 */
  __pyx_t_1 = PyNumber_Add(__pyx_kp_s_Series_object, __pyx_v_self->name); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_kp_s__10); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10534, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10536
 *         cdef str result = 'Series object ' + self.name + '\n'
 *         cdef tuple it
 *         cdef list items = self.items()             # <<<<<<<<<<<<<<
 * 
 *         if len(items) <= 50:
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10536, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_items = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10538
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
  if (unlikely(__pyx_v_items == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(3, 10538, __pyx_L1_error)
  }
  __pyx_t_3 = PyList_GET_SIZE(__pyx_v_items); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(3, 10538, __pyx_L1_error)
  __pyx_t_4 = ((__pyx_t_3 <= 50) != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10539
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
      __PYX_ERR(3, 10539, __pyx_L1_error)
    }
    __pyx_t_2 = __pyx_v_items; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 10539, __pyx_L1_error)
      #else
      __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10539, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10540
 *         if len(items) <= 50:
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10540, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 10540, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10540, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 10540, __pyx_L1_error)
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10540, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 10540, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10539
 * 
 *         if len(items) <= 50:
 *             for it in items:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10538
 *         cdef list items = self.items()
 * 
 *         if len(items) <= 50:             # <<<<<<<<<<<<<<
 *             for it in items:
 *                 result += out_format.format(key=it[0], value=it[1])
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10543
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
  /*else*/ {
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10543, __pyx_L1_error)
    }
    __pyx_t_2 = __Pyx_PyList_GetSlice(__pyx_v_items, 0, 25); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 10543, __pyx_L1_error)
      #else
      __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(3, 10543, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_2));
      __pyx_t_2 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10544
 *         else:
 *             for it in items[:25]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *             result += '...\n'
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_6 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10544, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 10544, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10544, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 10544, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10544, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_6)->tp_name), 0))) __PYX_ERR(3, 10544, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_6));
      __pyx_t_6 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10543
 * 
 *         else:
 *             for it in items[:25]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10546
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *             result += '...\n'             # <<<<<<<<<<<<<<
 * 
 *             for it in items[-25:]:
 */
    __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_kp_s__11); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10546, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10548
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    if (unlikely(__pyx_v_items == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10548, __pyx_L1_error)
    }
    __pyx_t_5 = __Pyx_PyList_GetSlice(__pyx_v_items, -25L, PY_SSIZE_T_MAX); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10548, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(3, 10548, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 10548, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
      __pyx_t_5 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10549
 * 
 *             for it in items[-25:]:
 *                 result += out_format.format(key=it[0], value=it[1])             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_out_format, __pyx_n_s_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10549, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_key, PyTuple_GET_ITEM(__pyx_v_it, 0)) < 0) __PYX_ERR(3, 10549, __pyx_L1_error)
      if (unlikely(__pyx_v_it == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10549, __pyx_L1_error)
      }
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_value, PyTuple_GET_ITEM(__pyx_v_it, 1)) < 0) __PYX_ERR(3, 10549, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_result, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10549, __pyx_L1_error)
      __Pyx_DECREF_SET(__pyx_v_result, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10548
 *             result += '...\n'
 * 
 *             for it in items[-25:]:             # <<<<<<<<<<<<<<
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10551
 *                 result += out_format.format(key=it[0], value=it[1])
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10531
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef str out_format = '{key}: {value}\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("redblackpy.series.tree_series.__TreeSeries_object.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out_format);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_XDECREF(__pyx_v_items);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10554
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_48__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_48__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_47__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_47__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10556
 *     def __repr__(self):
 * 
 *         return self.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10556, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10556, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10554
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_object_51generator35(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "redblackpy/cython_source/tree_series_dtype.pxi":10559
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_50__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_50__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_49__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_49__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  __pyx_cur_scope = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__(__pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(3, 10559, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_object_51generator35, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_iter, __pyx_n_s_TreeSeries_object___iter, __pyx_n_s_redblackpy_series_tree_series); if (unlikely(!gen)) __PYX_ERR(3, 10559, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_10redblackpy_6series_11tree_series_19__TreeSeries_object_51generator35(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *__pyx_cur_scope = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_1;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_2;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 10559, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10563
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_object(it)
 * 
 */
  __pyx_t_2 = &(*__pyx_cur_scope->__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_1 = __pyx_t_2->begin();
  for (;;) {
    if (!(__pyx_t_1 != __pyx_t_2->end())) break;
    __pyx_t_3 = *__pyx_t_1;
    ++__pyx_t_1;
    __pyx_cur_scope->__pyx_v_it = __pyx_t_3;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10564
 * 
 *         for it in deref(self.__index):
 *             yield __deref_value_ptr_object(it)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_cur_scope->__pyx_v_it); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_1;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_2;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_1 = __pyx_cur_scope->__pyx_t_0;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_1;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(3, 10564, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10563
 *         cdef node_ptr it
 * 
 *         for it in deref(self.__index):             # <<<<<<<<<<<<<<
 *             yield __deref_value_ptr_object(it)
 * 
 */
  }
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10559
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10567
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_53__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_52__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_52__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __pyx_v_error;
  PyObject *__pyx_v_result = 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;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10569
 *     def __getitem__(self, key):
 * 
 *         cdef int32_t error = TYPE_ERROR             # <<<<<<<<<<<<<<
 *         cdef object result
 * 
 */
  __pyx_v_error = __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10572
 *         cdef object result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_1) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10573
 * 
 *         if self.__index.size() == 0:
 *             return self.extrapolate             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(key, slice):
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_self->extrapolate);
    __pyx_r = __pyx_v_self->extrapolate;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10572
 *         cdef object result
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             return self.extrapolate
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10575
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10576
 * 
 *         if isinstance(key, slice):
 *             return self.__get_item_slice(key)             # <<<<<<<<<<<<<<
 * 
 *         result = self.__get_item(self, key, &error)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___get_item_slice(__pyx_v_self, __pyx_v_key)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10576, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10575
 *             return self.extrapolate
 * 
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.__get_item_slice(key)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10578
 *             return self.__get_item_slice(key)
 * 
 *         result = self.__get_item(self, key, &error)             # <<<<<<<<<<<<<<
 * 
 *         if error == 0:
 */
  __pyx_t_3 = __pyx_v_self->__pyx___get_item(__pyx_v_self, __pyx_v_key, (&__pyx_v_error)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10580
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_2 = ((__pyx_v_error == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10581
 * 
 *         if error == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if error == INT_KEY_ERROR:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_v_result);
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10580
 *         result = self.__get_item(self, key, &error)
 * 
 *         if error == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10583
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  __pyx_t_2 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_INT_KEY_ERROR) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10584
 * 
 *         if error == INT_KEY_ERROR:
 *             raise KeyError( str(key) )             # <<<<<<<<<<<<<<
 * 
 *         if error == TYPE_ERROR:
 */
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_KeyError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10584, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 10584, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10583
 *             return result
 * 
 *         if error == INT_KEY_ERROR:             # <<<<<<<<<<<<<<
 *             raise KeyError( str(key) )
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10586
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  __pyx_t_2 = ((__pyx_v_error == __pyx_e_10redblackpy_6series_11tree_series_TYPE_ERROR) != 0);
  if (unlikely(__pyx_t_2)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10587
 * 
 *         if error == TYPE_ERROR:
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_class); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_name_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_kp_s_Inconsistent_key_type, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(3, 10587, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10586
 *             raise KeyError( str(key) )
 * 
 *         if error == TYPE_ERROR:             # <<<<<<<<<<<<<<
 *             raise TypeError("Inconsistent key type: " + key.__class__.__name__)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10567
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef int32_t error = TYPE_ERROR
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10590
 * 
 * 
 *     def __setitem__(self, key, object value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_55__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_54__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_54__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_key_holder;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10592
 *     def __setitem__(self, key, object value):
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)             # <<<<<<<<<<<<<<
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 */
  __pyx_v_key_holder = __pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject(__pyx_v_key);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10593
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 *         cdef node_ptr node = self.__index.insert_search(key_holder)             # <<<<<<<<<<<<<<
 * 
 *         if self.__index.size() == 0:
 */
  try {
    __pyx_t_1 = __pyx_v_self->__pyx_base.__pyx___index->insert_search(__pyx_v_key_holder);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10593, __pyx_L1_error)
  }
  __pyx_v_node = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10595
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_object(self.__index, node, key, value)
 * 
 */
  __pyx_t_2 = ((__pyx_v_self->__pyx_base.__pyx___index->size() == 0) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10596
 * 
 *         if self.__index.size() == 0:
 *             __insert_node_by_ptr_object(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_object(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10596, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10595
 *         cdef node_ptr node = self.__index.insert_search(key_holder)
 * 
 *         if self.__index.size() == 0:             # <<<<<<<<<<<<<<
 *             __insert_node_by_ptr_object(self.__index, node, key, value)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10599
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_object(node, value)
 * 
 */
  /*else*/ {
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_key, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10599, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(3, 10599, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_2) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10600
 *         else:
 *             if self.__get_key_from_ptr(node) == key:
 *                 __set_value_object(node, value)             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_f_10redblackpy_6series_11tree_series___set_value_object(__pyx_v_node, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10600, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10599
 * 
 *         else:
 *             if self.__get_key_from_ptr(node) == key:             # <<<<<<<<<<<<<<
 *                 __set_value_object(node, value)
 * 
 */
      goto __pyx_L4;
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10603
 * 
 *             else:
 *                 __insert_node_by_ptr_object(self.__index, node, key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    /*else*/ {
      __pyx_f_10redblackpy_6series_11tree_series___insert_node_by_ptr_object(__pyx_v_self->__pyx_base.__pyx___index, __pyx_v_node, __pyx_v_key, __pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10603, __pyx_L1_error)
    }
    __pyx_L4:;
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10590
 * 
 * 
 *     def __setitem__(self, key, object value):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject key_holder = to_c_pyobject(key)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10609
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_object add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_object)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10609, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_57add)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10609, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10609, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10609, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10609, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10609, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10609, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10611
 *     cpdef __TreeSeries_object add(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __add_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___add_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10611, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10609
 *     # Emulating numeric types
 *     #--------------------------------------------------------------------------------------------
 *     cpdef __TreeSeries_object add(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __add_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_57add(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10609, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_56add(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_56add(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("add", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_add(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10609, __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("redblackpy.series.tree_series.__TreeSeries_object.add", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10614
 * 
 * 
 *     cpdef __TreeSeries_object sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_object)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_59sub)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10614, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10614, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10614, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10614, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10614, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10616
 *     cpdef __TreeSeries_object sub(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __sub_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___sub_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10614
 * 
 * 
 *     cpdef __TreeSeries_object sub(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __sub_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_59sub(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("sub (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10614, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_58sub(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_58sub(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("sub", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_sub(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10614, __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("redblackpy.series.tree_series.__TreeSeries_object.sub", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10619
 * 
 * 
 *     cpdef __TreeSeries_object mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_object)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10619, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_61mul)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10619, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10619, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10619, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10619, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10619, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10621
 *     cpdef __TreeSeries_object mul(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __mul_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___mul_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10621, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10619
 * 
 * 
 *     cpdef __TreeSeries_object mul(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __mul_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_61mul(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mul (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10619, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_60mul(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_60mul(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("mul", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_mul(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10619, __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("redblackpy.series.tree_series.__TreeSeries_object.mul", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10624
 * 
 * 
 *     cpdef __TreeSeries_object div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_object)
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10624, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_63div)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_other)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10624, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10624, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_other)};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10624, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10624, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_other));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_other));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_other));
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10624, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10624, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10626
 *     cpdef __TreeSeries_object div(self, __BaseTreeSeries other):
 * 
 *         return self.__arithmetic(self, other, __div_object)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = ((PyObject *)__pyx_v_self->__pyx___arithmetic(__pyx_v_self, __pyx_v_other, __pyx_f_10redblackpy_6series_11tree_series___div_object)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10624
 * 
 * 
 *     cpdef __TreeSeries_object div(self, __BaseTreeSeries other):             # <<<<<<<<<<<<<<
 * 
 *         return self.__arithmetic(self, other, __div_object)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_63div(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("div (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries, 1, "other", 0))) __PYX_ERR(3, 10624, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_62div(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_62div(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("div", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_div(__pyx_v_self, __pyx_v_other, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10624, __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("redblackpy.series.tree_series.__TreeSeries_object.div", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10629
 * 
 * 
 *     cpdef __TreeSeries_object lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("lshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10629, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_65lshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10629, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10629, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10629, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10629, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10629, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10631
 *     cpdef __TreeSeries_object lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10632
 * 
 *         if isinstance(shift_param, int):
 *             return self.__lshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 10632, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___lshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10632, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10631
 *     cpdef __TreeSeries_object lshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__lshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10629
 * 
 * 
 *     cpdef __TreeSeries_object lshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_65lshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("lshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_64lshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_64lshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("lshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_lshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10629, __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("redblackpy.series.tree_series.__TreeSeries_object.lshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10635
 * 
 * 
 *     cpdef __TreeSeries_object rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  __Pyx_RefNannySetupContext("rshift", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10635, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_67rshift)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10635, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10635, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_shift_param};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10635, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10635, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_shift_param);
          __Pyx_GIVEREF(__pyx_v_shift_param);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_shift_param);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10635, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object))))) __PYX_ERR(3, 10635, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10637
 *     cpdef __TreeSeries_object rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  __pyx_t_6 = PyInt_Check(__pyx_v_shift_param); 
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10638
 * 
 *         if isinstance(shift_param, int):
 *             return self.__rshift_int(shift_param)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_shift_param); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(3, 10638, __pyx_L1_error)
    __pyx_t_1 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx___rshift_int(__pyx_v_self, __pyx_t_8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_1);
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10637
 *     cpdef __TreeSeries_object rshift(self, shift_param):
 * 
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 *             return self.__rshift_int(shift_param)
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10635
 * 
 * 
 *     cpdef __TreeSeries_object rshift(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         if isinstance(shift_param, int):
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_67rshift(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("rshift (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_66rshift(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_66rshift(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("rshift", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_rshift(__pyx_v_self, __pyx_v_shift_param, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10635, __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("redblackpy.series.tree_series.__TreeSeries_object.rshift", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10644
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___init_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values) {
  PyObject *__pyx_v_it = 0;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10648
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  __pyx_t_1 = PyObject_Length(__pyx_v_index); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(3, 10648, __pyx_L1_error)
  __pyx_t_2 = PyObject_Length(__pyx_v_values); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(3, 10648, __pyx_L1_error)
  __pyx_t_3 = ((__pyx_t_1 != __pyx_t_2) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10649
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_IndexError, __pyx_tuple__182, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(3, 10649, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10648
 *         cdef tuple it
 * 
 *         if len(index) != len(values):             # <<<<<<<<<<<<<<
 *             raise IndexError("Index must have the same length as values.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10651
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_INCREF(__pyx_v_index);
  __Pyx_GIVEREF(__pyx_v_index);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
  __Pyx_INCREF(__pyx_v_values);
  __Pyx_GIVEREF(__pyx_v_values);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10651, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10651, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10651, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 10651, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 10651, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 10651, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 10651, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if (!(likely(PyTuple_CheckExact(__pyx_t_5))||((__pyx_t_5) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_5)->tp_name), 0))) __PYX_ERR(3, 10651, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_it, ((PyObject*)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10652
 * 
 *         for it in zip(index, values):
 *             self.insert(it[0], it[1])             # <<<<<<<<<<<<<<
 * 
 * 
 */
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10652, __pyx_L1_error)
    }
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_v_it, 0);
    __Pyx_INCREF(__pyx_t_5);
    if (unlikely(__pyx_v_it == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10652, __pyx_L1_error)
    }
    __pyx_t_7 = PyTuple_GET_ITEM(__pyx_v_it, 1);
    __Pyx_INCREF(__pyx_t_7);
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_t_5, __pyx_t_7, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10652, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10651
 *             raise IndexError("Index must have the same length as values.")
 * 
 *         for it in zip(index, values):             # <<<<<<<<<<<<<<
 *             self.insert(it[0], it[1])
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10644
 *     # Private methods
 *     #--------------------------------------------------------------------------------------------
 *     cdef void __init_tree(self, index, values) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef tuple it
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__init_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10655
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

static void __pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___init_tree_index(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_index) {
  PyObject *__pyx_v_it = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__init_tree_index", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10657
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
    __pyx_t_1 = __pyx_v_index; __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_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10657, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10657, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 10657, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10657, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __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_ERR(3, 10657, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10657, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #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(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(3, 10657, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_it, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10658
 * 
 *         for it in index:
 *             self.insert(it, 0)             # <<<<<<<<<<<<<<
 * 
 * 
 */
    ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->insert(__pyx_v_self, __pyx_v_it, __pyx_int_0, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10658, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10657
 *     cdef void __init_tree_index(self, index) except*:
 * 
 *         for it in index:             # <<<<<<<<<<<<<<
 *             self.insert(it, 0)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10655
 * 
 * 
 *     cdef void __init_tree_index(self, index) except*:             # <<<<<<<<<<<<<<
 * 
 *         for it in index:
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__init_tree_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_it);
  __Pyx_RefNannyFinishContext();
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10661
 * 
 * 
 *     cdef object __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_linear(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  int __pyx_t_3;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__get_item_linear", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10664
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10667
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->linear_search_from(__pyx_v_self->__pyx_base.__pyx___last_call, __pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10667, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10668
 * 
 *         bounds = self.__index.linear_search_from(self.__last_call, c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         if bounds.first != self.link():
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10670
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
  __pyx_t_3 = ((__pyx_v_bounds.first != __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (__pyx_t_3) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10671
 * 
 *         if bounds.first != self.link():
 *             self.__last_call = bounds.first             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_4 = __pyx_v_bounds.first;
    __pyx_v_self->__pyx_base.__pyx___last_call = __pyx_t_4;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10670
 *         error[0] = 0
 * 
 *         if bounds.first != self.link():             # <<<<<<<<<<<<<<
 *             self.__last_call = bounds.first
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10674
 * 
 *         else:
 *             self.__last_call = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  /*else*/ {
    __pyx_v_self->__pyx_base.__pyx___last_call = (*__pyx_v_self->__pyx_base.__pyx___index->begin());
  }
  __pyx_L3:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10676
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10677
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 *                                    self.link(), self.extrapolate,             # <<<<<<<<<<<<<<
 *                                    error )
 * 
 */
  __pyx_t_5 = __pyx_v_self->extrapolate;
  __Pyx_INCREF(__pyx_t_5);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10676
 *             self.__last_call = deref( self.__index.begin() )
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_t_6 = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_t_5, __pyx_v_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10676, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10661
 * 
 * 
 *     cdef object __get_item_linear(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         #bug? cython 0.28.3 translate c_key to const, if do not declare it directly
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__get_item_linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10681
 * 
 * 
 *     cdef object __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

static PyObject *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_tree(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *__pyx_v_error) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  std::pair<__pyx_t_10redblackpy_6series_11tree_series_node_ptr,__pyx_t_10redblackpy_6series_11tree_series_node_ptr>  __pyx_v_bounds;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_1;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__get_item_tree", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10683
 *     cdef object __get_item_tree(self, key, int32_t* error):
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)             # <<<<<<<<<<<<<<
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 */
  __pyx_t_1.data = ((PyObject *)__pyx_v_key);
  __pyx_v_c_key = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10686
 *         cdef pair[node_ptr, node_ptr] bounds
 * 
 *         bounds = self.__index.tree_search(c_key)             # <<<<<<<<<<<<<<
 *         error[0] = 0
 * 
 */
  try {
    __pyx_t_2 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
    __PYX_ERR(3, 10686, __pyx_L1_error)
  }
  __pyx_v_bounds = __pyx_t_2;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10687
 * 
 *         bounds = self.__index.tree_search(c_key)
 *         error[0] = 0             # <<<<<<<<<<<<<<
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 */
  (__pyx_v_error[0]) = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10689
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __Pyx_XDECREF(__pyx_r);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10690
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,
 *                                    self.link(), self.extrapolate,             # <<<<<<<<<<<<<<
 *                                    error )
 * 
 */
  __pyx_t_3 = __pyx_v_self->extrapolate;
  __Pyx_INCREF(__pyx_t_3);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10689
 *         error[0] = 0
 * 
 *         return self.__interpolate( bounds.first, bounds.second, key,             # <<<<<<<<<<<<<<
 *                                    self.link(), self.extrapolate,
 *                                    error )
 */
  __pyx_t_4 = __pyx_v_self->__pyx___interpolate(__pyx_v_bounds.first, __pyx_v_bounds.second, __pyx_v_key, __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self)), __pyx_t_3, __pyx_v_error); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 10689, __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;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10681
 * 
 * 
 *     cdef object __get_item_tree(self, key, int32_t* error):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key = c_pyobject(<PyObject*>key)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__get_item_tree", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10694
 * 
 * 
 *     cdef __TreeSeries_object __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_slice(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_key) {
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_v_c_key;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_begin;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_end;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  __pyx_t_10redblackpy_6series_11tree_series_c_pyobject __pyx_t_7;
  std::pair<qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr,qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr>  __pyx_t_8;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_9;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::node_ptr __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__get_item_slice", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10697
 * 
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )             # <<<<<<<<<<<<<<
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_object result
 */
  __pyx_v_begin = (*__pyx_v_self->__pyx_base.__pyx___index->begin());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10698
 *         cdef c_pyobject c_key
 *         cdef node_ptr begin = deref( self.__index.begin() )
 *         cdef node_ptr end = deref( self.__index.back() )             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 */
  __pyx_v_end = (*__pyx_v_self->__pyx_base.__pyx___index->back());

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10701
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                              interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                              arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10701, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10701, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10702
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         if self.__len__() == 0:
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10701, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10700
 *         cdef node_ptr end = deref( self.__index.back() )
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                              interpolate=self.interpolate_type,
 *                                              arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10700, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10704
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_len); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10704, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10704, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_EqObjC(__pyx_t_2, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(3, 10704, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10705
 * 
 *         if self.__len__() == 0:
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None and key.stop is not None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10704
 *                                              arithmetic=self.arithmetic )
 * 
 *         if self.__len__() == 0:             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10707
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = (__pyx_t_5 != 0);
  if (__pyx_t_6) {
  } else {
    __pyx_t_4 = __pyx_t_6;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_6 != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10709
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.begin(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10709, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L8_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10710
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *             if key.start > self.end() and key.stop < self.end():
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10709
 *         if key.start is not None and key.stop is not None:
 * 
 *             if key.start < self.begin() and key.stop < self.begin():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10712
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_5) {
    } else {
      __pyx_t_4 = __pyx_t_5;
      goto __pyx_L11_bool_binop_done;
    }
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.end(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(3, 10712, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = __pyx_t_5;
    __pyx_L11_bool_binop_done:;
    if (__pyx_t_4) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10713
 * 
 *             if key.start > self.end() and key.stop < self.end():
 *                 return result             # <<<<<<<<<<<<<<
 * 
 *         if key.start is not None:
 */
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(((PyObject *)__pyx_v_result));
      __pyx_r = __pyx_v_result;
      goto __pyx_L0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10712
 *                 return result
 * 
 *             if key.start > self.end() and key.stop < self.end():             # <<<<<<<<<<<<<<
 *                 return result
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10707
 *             return result
 * 
 *         if key.start is not None and key.stop is not None:             # <<<<<<<<<<<<<<
 * 
 *             if key.start < self.begin() and key.stop < self.begin():
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10715
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10715, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10716
 * 
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)             # <<<<<<<<<<<<<<
 *             begin = self.__index.tree_search(c_key).second
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10716, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10717
 *         if key.start is not None:
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second             # <<<<<<<<<<<<<<
 * 
 *         if key.stop is not None:
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 10717, __pyx_L1_error)
    }
    __pyx_t_9 = __pyx_t_8.second;
    __pyx_v_begin = __pyx_t_9;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10715
 *                 return result
 * 
 *         if key.start is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.start)
 *             begin = self.__index.tree_search(c_key).second
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10719
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10719, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = (__pyx_t_1 != Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_4 = (__pyx_t_5 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10720
 * 
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)             # <<<<<<<<<<<<<<
 *             end = self.__index.tree_search(c_key).first
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10720, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7.data = ((PyObject *)__pyx_t_1);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_c_key = __pyx_t_7;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10721
 *         if key.stop is not None:
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first             # <<<<<<<<<<<<<<
 * 
 *         if compare_func(end.key, begin.key) \
 */
    try {
      __pyx_t_8 = __pyx_v_self->__pyx_base.__pyx___index->tree_search(__pyx_v_c_key);
    } catch(...) {
      try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_KeyError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_KeyError); }
      __PYX_ERR(3, 10721, __pyx_L1_error)
    }
    __pyx_t_10 = __pyx_t_8.first;
    __pyx_v_end = __pyx_t_10;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10719
 *             begin = self.__index.tree_search(c_key).second
 * 
 *         if key.stop is not None:             # <<<<<<<<<<<<<<
 *             c_key = c_pyobject(<PyObject*>key.stop)
 *             end = self.__index.tree_search(c_key).first
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10723
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  __pyx_t_5 = (__pyx_f_10redblackpy_6series_11tree_series_compare_func(__pyx_v_end->key, __pyx_v_begin->key) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L16_bool_binop_done;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10724
 * 
 *         if compare_func(end.key, begin.key) \
 *             and ( not equal(end.key, begin.key) ):             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  __pyx_t_5 = ((!(__pyx_f_10redblackpy_6series_11tree_series_equal(__pyx_v_end->key, __pyx_v_begin->key) != 0)) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L16_bool_binop_done:;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10723
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10726
 *             and ( not equal(end.key, begin.key) ):
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if begin == self.link() or end == self.link():
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10723
 *             end = self.__index.tree_search(c_key).first
 * 
 *         if compare_func(end.key, begin.key) \             # <<<<<<<<<<<<<<
 *             and ( not equal(end.key, begin.key) ):
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10728
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  __pyx_t_5 = ((__pyx_v_begin == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  if (!__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L19_bool_binop_done;
  }
  __pyx_t_5 = ((__pyx_v_end == __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self))) != 0);
  __pyx_t_4 = __pyx_t_5;
  __pyx_L19_bool_binop_done:;
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10729
 * 
 *         if begin == self.link() or end == self.link():
 *             return result             # <<<<<<<<<<<<<<
 * 
 *         if key.step is None:
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10728
 *             return result
 * 
 *         if begin == self.link() or end == self.link():             # <<<<<<<<<<<<<<
 *             return result
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10731
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10731, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = (__pyx_t_1 == Py_None);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10732
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10733
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10733, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10732
 * 
 *         if key.step is None:
 *             return self.truncate( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end) )
 * 
 */
    __pyx_t_3 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->truncate(__pyx_v_self, __pyx_t_1, __pyx_t_2, 0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10732, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10731
 *             return result
 * 
 *         if key.step is None:             # <<<<<<<<<<<<<<
 *             return self.truncate( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end) )
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10736
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
  /*else*/ {
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __pyx_t_3 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_begin); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10737
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),             # <<<<<<<<<<<<<<
 *                                   key.step )
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_end); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10737, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10738
 *             return self.periodic( self.__get_key_from_ptr(begin),
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10738, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10736
 * 
 *         else:
 *             return self.periodic( self.__get_key_from_ptr(begin),             # <<<<<<<<<<<<<<
 *                                   self.__get_key_from_ptr(end),
 *                                   key.step )
 */
    __pyx_t_11 = ((PyObject *)((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->periodic(__pyx_v_self, __pyx_t_3, __pyx_t_2, __pyx_t_1, 0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(3, 10736, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_11);
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10694
 * 
 * 
 *     cdef __TreeSeries_object __get_item_slice(self, key):             # <<<<<<<<<<<<<<
 * 
 *         cdef c_pyobject c_key
 */

  /* 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_11);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__get_item_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10741
 * 
 * 
 *     cdef __TreeSeries_object __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___lshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  __Pyx_RefNannySetupContext("__lshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10744
 * 
 *         cdef __TreeSeries_object result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10746
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10747
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10750
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10750, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10750, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10751
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10750, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10749
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10749, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10752
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  __pyx_t_3 = ((__pyx_v_shift_param <= 0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10753
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__183, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10753, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(3, 10753, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10752
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:             # <<<<<<<<<<<<<<
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10755
 *             raise ValueError("Shift parameter must be more than zero.")
 * 
 *         for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *             if append_status:
 */
  __pyx_t_4 = 0;
  if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
    PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
    __PYX_ERR(3, 10755, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_5), (&__pyx_t_6)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10755, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_1;
  __pyx_t_1 = 0;
  while (1) {
    __pyx_t_7 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_5, &__pyx_t_4, NULL, NULL, &__pyx_t_1, __pyx_t_6);
    if (unlikely(__pyx_t_7 == 0)) break;
    if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(3, 10755, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10755, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10757
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    __pyx_t_3 = (__pyx_v_append_status != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10758
 * 
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])             # <<<<<<<<<<<<<<
 *                 delay_holder.pop(0)
 * 
 */
      __pyx_t_1 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
      __Pyx_INCREF(__pyx_t_1);
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10758, __pyx_L1_error)
      }
      __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_8);
      ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_8, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10758, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10759
 *             if append_status:
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *             if count == shift_param - 1:
 */
      __pyx_t_8 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 10759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10757
 *         for pair in self.iteritems():
 * 
 *             if append_status:             # <<<<<<<<<<<<<<
 *                 result.insert(delay_holder[0], pair[1])
 *                 delay_holder.pop(0)
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10761
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    __pyx_t_3 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
    if (__pyx_t_3) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10762
 * 
 *             if count == shift_param - 1:
 *                 append_status = True             # <<<<<<<<<<<<<<
 * 
 *             delay_holder.append(pair[0])
 */
      __pyx_v_append_status = 1;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10761
 *                 delay_holder.pop(0)
 * 
 *             if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                 append_status = True
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10764
 *                 append_status = True
 * 
 *             delay_holder.append(pair[0])             # <<<<<<<<<<<<<<
 *             count += 1
 * 
 */
    if (unlikely(__pyx_v_pair == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(3, 10764, __pyx_L1_error)
    }
    __pyx_t_8 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
    __Pyx_INCREF(__pyx_t_8);
    __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_8); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(3, 10764, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10765
 * 
 *             delay_holder.append(pair[0])
 *             count += 1             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
    __pyx_v_count = (__pyx_v_count + 1);
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10767
 *             count += 1
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10741
 * 
 * 
 *     cdef __TreeSeries_object __lshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__lshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10770
 * 
 * 
 *     cdef __TreeSeries_object __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___rshift_int(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, Py_ssize_t __pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  PyObject *__pyx_v_delay_holder = 0;
  PyObject *__pyx_v_pair = 0;
  Py_ssize_t __pyx_v_count;
  bool __pyx_v_append_status;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__rshift_int", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10773
 * 
 *         cdef __TreeSeries_object result
 *         cdef list delay_holder = []             # <<<<<<<<<<<<<<
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_delay_holder = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10775
 *         cdef list delay_holder = []
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0             # <<<<<<<<<<<<<<
 *         cdef bool append_status = False
 * 
 */
  __pyx_v_count = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10776
 *         cdef tuple pair
 *         cdef Py_ssize_t count = 0
 *         cdef bool append_status = False             # <<<<<<<<<<<<<<
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 */
  __pyx_v_append_status = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10779
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10779, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10779, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10780
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if isinstance(shift_param, int):
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10779, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10778
 *         cdef bool append_status = False
 * 
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10778, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10781
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10781, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_Check(__pyx_t_2); 
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10783
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    __pyx_t_4 = ((__pyx_v_shift_param <= 0) != 0);
    if (unlikely(__pyx_t_4)) {

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10784
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__184, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(3, 10784, __pyx_L1_error)

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10783
 *         if isinstance(shift_param, int):
 * 
 *             if shift_param <= 0:             # <<<<<<<<<<<<<<
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 */
    }

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10786
 *                 raise ValueError("Shift parameter must be more than zero.")
 * 
 *             for pair in self.iteritems():             # <<<<<<<<<<<<<<
 * 
 *                 if append_status:
 */
    __pyx_t_5 = 0;
    if (unlikely(((PyObject *)__pyx_v_self) == Py_None)) {
      PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "iteritems");
      __PYX_ERR(3, 10786, __pyx_L1_error)
    }
    __pyx_t_1 = __Pyx_dict_iterator(((PyObject *)__pyx_v_self), 0, __pyx_n_s_iteritems, (&__pyx_t_6), (&__pyx_t_7)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10786, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2);
    __pyx_t_2 = __pyx_t_1;
    __pyx_t_1 = 0;
    while (1) {
      __pyx_t_8 = __Pyx_dict_iter_next(__pyx_t_2, __pyx_t_6, &__pyx_t_5, NULL, NULL, &__pyx_t_1, __pyx_t_7);
      if (unlikely(__pyx_t_8 == 0)) break;
      if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(3, 10786, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(3, 10786, __pyx_L1_error)
      __Pyx_XDECREF_SET(__pyx_v_pair, ((PyObject*)__pyx_t_1));
      __pyx_t_1 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10788
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      __pyx_t_4 = (__pyx_v_append_status != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10789
 * 
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])             # <<<<<<<<<<<<<<
 *                     delay_holder.pop(0)
 * 
 */
        if (unlikely(__pyx_v_pair == Py_None)) {
          PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
          __PYX_ERR(3, 10789, __pyx_L1_error)
        }
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_v_pair, 0);
        __Pyx_INCREF(__pyx_t_1);
        __pyx_t_9 = PyList_GET_ITEM(__pyx_v_delay_holder, 0);
        __Pyx_INCREF(__pyx_t_9);
        ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_result->__pyx_base.__pyx_vtab)->insert(__pyx_v_result, __pyx_t_1, __pyx_t_9, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10789, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10790
 *                 if append_status:
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)             # <<<<<<<<<<<<<<
 * 
 *                 if count == shift_param - 1:
 */
        __pyx_t_9 = __Pyx_PyList_PopIndex(__pyx_v_delay_holder, __pyx_int_0, 0, 1, Py_ssize_t, PyInt_FromSsize_t); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 10790, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10788
 *             for pair in self.iteritems():
 * 
 *                 if append_status:             # <<<<<<<<<<<<<<
 *                     result.insert(pair[0], delay_holder[0])
 *                     delay_holder.pop(0)
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10792
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      __pyx_t_4 = ((__pyx_v_count == (__pyx_v_shift_param - 1)) != 0);
      if (__pyx_t_4) {

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10793
 * 
 *                 if count == shift_param - 1:
 *                     append_status = True             # <<<<<<<<<<<<<<
 * 
 *                 delay_holder.append(pair[1])
 */
        __pyx_v_append_status = 1;

        /* "redblackpy/cython_source/tree_series_dtype.pxi":10792
 *                     delay_holder.pop(0)
 * 
 *                 if count == shift_param - 1:             # <<<<<<<<<<<<<<
 *                     append_status = True
 * 
 */
      }

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10795
 *                     append_status = True
 * 
 *                 delay_holder.append(pair[1])             # <<<<<<<<<<<<<<
 *                 count += 1
 * 
 */
      if (unlikely(__pyx_v_pair == Py_None)) {
        PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
        __PYX_ERR(3, 10795, __pyx_L1_error)
      }
      __pyx_t_9 = PyTuple_GET_ITEM(__pyx_v_pair, 1);
      __Pyx_INCREF(__pyx_t_9);
      __pyx_t_10 = __Pyx_PyList_Append(__pyx_v_delay_holder, __pyx_t_9); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(3, 10795, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "redblackpy/cython_source/tree_series_dtype.pxi":10796
 * 
 *                 delay_holder.append(pair[1])
 *                 count += 1             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
      __pyx_v_count = (__pyx_v_count + 1);
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10798
 *                 count += 1
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(((PyObject *)__pyx_r));
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10781
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         if isinstance(shift_param, int):             # <<<<<<<<<<<<<<
 * 
 *             if shift_param <= 0:
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10770
 * 
 * 
 *     cdef __TreeSeries_object __rshift_int(self, Py_ssize_t shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */

  /* function exit code */
  __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__rshift_int", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_delay_holder);
  __Pyx_XDECREF(__pyx_v_pair);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10801
 * 
 * 
 *     cdef __TreeSeries_object __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_object action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___arithmetic_left(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object __pyx_v_action) {
  PyObject *__pyx_v_current = 0;
  __pyx_t_10redblackpy_6series_11tree_series_node_ptr __pyx_v_node;
  PyObject *__pyx_v_key = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator __pyx_t_3;
  qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject>  *__pyx_t_4;
  __pyx_t_10redblackpy_6series_11tree_series_rb_node_valued *__pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__arithmetic_left", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10809
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10809, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10810
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10809, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10808
 *         cdef object key
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10808, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10811
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         for node in deref(self.__index):
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10813
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  __pyx_t_4 = &(*__pyx_v_self->__pyx_base.__pyx___index);
  __pyx_t_3 = __pyx_t_4->begin();
  for (;;) {
    if (!(__pyx_t_3 != __pyx_t_4->end())) break;
    __pyx_t_5 = *__pyx_t_3;
    ++__pyx_t_3;
    __pyx_v_node = __pyx_t_5;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10815
 *         for node in deref(self.__index):
 * 
 *             key = self.__get_key_from_ptr(node)             # <<<<<<<<<<<<<<
 *             current = action(__deref_value_ptr_object(node), other[key])
 *             __insert_node_object(result.__index, key, current)
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), __pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10815, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10816
 * 
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_object(node), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_object(result.__index, key, current)
 * 
 */
    __pyx_t_2 = __pyx_f_10redblackpy_6series_11tree_series___deref_value_ptr_object(__pyx_v_node); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 10816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __pyx_v_action(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 10816, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_current, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10817
 *             key = self.__get_key_from_ptr(node)
 *             current = action(__deref_value_ptr_object(node), other[key])
 *             __insert_node_object(result.__index, key, current)             # <<<<<<<<<<<<<<
 * 
 *         other.off_itermode()
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_object(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10817, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10813
 *         other.on_itermode()
 * 
 *         for node in deref(self.__index):             # <<<<<<<<<<<<<<
 * 
 *             key = self.__get_key_from_ptr(node)
 */
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10819
 *             __insert_node_object(result.__index, key, current)
 * 
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10821
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10801
 * 
 * 
 *     cdef __TreeSeries_object __arithmetic_left( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                  arithmetic_object action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__arithmetic_left", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10824
 * 
 * 
 *     cdef __TreeSeries_object __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_object action ):
 * 
 */

static struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___arithmetic_union(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *__pyx_v_other, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object __pyx_v_action) {
  PyObject *__pyx_v_current = 0;
  PyObject *__pyx_v_key = 0;
  qseries::trees_iterator<__pyx_t_10redblackpy_6series_11tree_series_rb_tree,__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued>  __pyx_v_iterator;
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_v_trees;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr>  __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_t_4;
  std::string __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__arithmetic_union", 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10830
 *         cdef object key
 *         cdef trees_iterator[rb_tree, rb_node_valued] iterator
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)             # <<<<<<<<<<<<<<
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 */
  try {
    __pyx_t_1 = std::vector<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr> (2);
  } catch(...) {
    __Pyx_CppExn2PyErr();
    __PYX_ERR(3, 10830, __pyx_L1_error)
  }
  __pyx_v_trees = __pyx_t_1;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10833
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,             # <<<<<<<<<<<<<<
 *                                                arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10833, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_v_self->interpolate_type) < 0) __PYX_ERR(3, 10833, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10834
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         trees[0] = self.__index
 */
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_v_self->arithmetic) < 0) __PYX_ERR(3, 10833, __pyx_L1_error)

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10832
 *         cdef vector[rb_tree_ptr] trees = vector[rb_tree_ptr](2)
 *         cdef __TreeSeries_object result
 *         result = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                interpolate=self.interpolate_type,
 *                                                arithmetic=self.arithmetic )
 */
  __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10832, __pyx_L1_error)
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10836
 *                                                arithmetic=self.arithmetic )
 * 
 *         trees[0] = self.__index             # <<<<<<<<<<<<<<
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 */
  __pyx_t_4 = __pyx_v_self->__pyx_base.__pyx___index;
  (__pyx_v_trees[0]) = __pyx_t_4;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10837
 * 
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()             # <<<<<<<<<<<<<<
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 */
  (__pyx_v_trees[1]) = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_other);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10838
 *         trees[0] = self.__index
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")
 */
  __pyx_v_iterator.set_equal(__pyx_f_10redblackpy_6series_11tree_series_equal_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10839
 *         trees[1] = other.get_tree()
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)             # <<<<<<<<<<<<<<
 *         iterator.set_iterator(trees, "forward")
 * 
 */
  __pyx_v_iterator.set_compare(__pyx_f_10redblackpy_6series_11tree_series_comp_pair);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10840
 *         iterator.set_equal(equal_pair)
 *         iterator.set_compare(comp_pair)
 *         iterator.set_iterator(trees, "forward")             # <<<<<<<<<<<<<<
 * 
 *         self.on_itermode()
 */
  __pyx_t_5 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_forward); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10840, __pyx_L1_error)
  try {
    __pyx_v_iterator.set_iterator(__pyx_v_trees, __pyx_t_5);
  } catch(...) {
    try { throw; } catch(const std::exception& exn) { PyErr_SetString(__pyx_builtin_TypeError, exn.what()); } catch(...) { PyErr_SetNone(__pyx_builtin_TypeError); }
    __PYX_ERR(3, 10840, __pyx_L1_error)
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10842
 *         iterator.set_iterator(trees, "forward")
 * 
 *         self.on_itermode()             # <<<<<<<<<<<<<<
 *         other.on_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10843
 * 
 *         self.on_itermode()
 *         other.on_itermode()             # <<<<<<<<<<<<<<
 * 
 *         while not iterator.empty():
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->on_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10845
 *         other.on_itermode()
 * 
 *         while not iterator.empty():             # <<<<<<<<<<<<<<
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 */
  while (1) {
    __pyx_t_6 = ((!(__pyx_v_iterator.empty() != 0)) != 0);
    if (!__pyx_t_6) break;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10846
 * 
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data             # <<<<<<<<<<<<<<
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_object(result.__index, key, current)
 */
    __pyx_t_7 = (*__pyx_v_iterator).key.data;
    __pyx_t_3 = ((PyObject *)__pyx_t_7);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10847
 *         while not iterator.empty():
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])             # <<<<<<<<<<<<<<
 *             __insert_node_object(result.__index, key, current)
 *             pinc(iterator)
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_8)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_8);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    if (!__pyx_t_8) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10847, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10847, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
        PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10847, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 10847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 10847, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_other), __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_9 = __pyx_v_action(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_9)) __PYX_ERR(3, 10847, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_current, __pyx_t_9);
    __pyx_t_9 = 0;

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10848
 *             key = <object>deref(iterator).key.data
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_object(result.__index, key, current)             # <<<<<<<<<<<<<<
 *             pinc(iterator)
 * 
 */
    __pyx_f_10redblackpy_6series_11tree_series___insert_node_object(__pyx_v_result->__pyx_base.__pyx___index, __pyx_v_key, __pyx_v_current); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 10848, __pyx_L1_error)

    /* "redblackpy/cython_source/tree_series_dtype.pxi":10849
 *             current = action(self.__getitem__(key), other[key])
 *             __insert_node_object(result.__index, key, current)
 *             pinc(iterator)             # <<<<<<<<<<<<<<
 * 
 *         self.off_itermode()
 */
    (void)((__pyx_v_iterator++));
  }

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10851
 *             pinc(iterator)
 * 
 *         self.off_itermode()             # <<<<<<<<<<<<<<
 *         other.off_itermode()
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self), 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10852
 * 
 *         self.off_itermode()
 *         other.off_itermode()             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_other->__pyx_vtab)->off_itermode(__pyx_v_other, 0);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10854
 *         other.off_itermode()
 * 
 *         return result             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10824
 * 
 * 
 *     cdef __TreeSeries_object __arithmetic_union( self, __BaseTreeSeries other,             # <<<<<<<<<<<<<<
 *                                                   arithmetic_object action ):
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__arithmetic_union", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_current);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10259
 *     cdef arithmetic_type_object __arithmetic
 * 
 *     cdef public   str  name             # <<<<<<<<<<<<<<
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 10259, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10260
 * 
 *     cdef public   str  name
 *     cdef public   str  arithmetic             # <<<<<<<<<<<<<<
 *     cdef readonly str  interpolate_type
 *     cdef public   object extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->arithmetic);
  __pyx_r = __pyx_v_self->arithmetic;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(3, 10260, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.arithmetic.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->arithmetic);
  __Pyx_DECREF(__pyx_v_self->arithmetic);
  __pyx_v_self->arithmetic = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10261
 *     cdef public   str  name
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type             # <<<<<<<<<<<<<<
 *     cdef public   object extrapolate
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_16interpolate_type_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_16interpolate_type_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_16interpolate_type___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_16interpolate_type___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->interpolate_type);
  __pyx_r = __pyx_v_self->interpolate_type;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/cython_source/tree_series_dtype.pxi":10262
 *     cdef public   str  arithmetic
 *     cdef readonly str  interpolate_type
 *     cdef public   object extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate___get__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->extrapolate);
  __pyx_r = __pyx_v_self->extrapolate;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(__pyx_v_self->extrapolate);
  __Pyx_DECREF(__pyx_v_self->extrapolate);
  __pyx_v_self->extrapolate = __pyx_v_value;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->extrapolate);
  __Pyx_DECREF(__pyx_v_self->extrapolate);
  __pyx_v_self->extrapolate = Py_None;

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_69__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_68__reduce_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_68__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__185, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_71__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_70__setstate_cython__(((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_19__TreeSeries_object_70__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__186, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(4, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.__TreeSeries_object.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":61
 *     with time series.
 *     """
 *     def __init__( self, object index=None, object values=None, str dtype="float32",             # <<<<<<<<<<<<<<
 *                   str name="Untitled", str interpolate="floor", extrapolate=0,
 *                   str arithmetic="left" ):
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series___init__[] = "\n        :param iterable index - iterable with arbitrary datetime objects.\n        :param iterable values - iterable with arbitrary datetime objects.\n        :param string dtype - value type.\n        :param string name.\n        :param string interpolate - interpolation method.\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_10redblackpy_6series_11tree_series_6Series___init__;
#endif
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_v_values = 0;
  PyObject *__pyx_v_dtype = 0;
  PyObject *__pyx_v_name = 0;
  PyObject *__pyx_v_interpolate = 0;
  PyObject *__pyx_v_extrapolate = 0;
  PyObject *__pyx_v_arithmetic = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,&__pyx_n_s_values,&__pyx_n_s_dtype,&__pyx_n_s_name,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[7] = {0,0,0,0,0,0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_None);
    values[2] = ((PyObject*)__pyx_n_s_float32);
    values[3] = ((PyObject*)__pyx_n_s_Untitled);
    values[4] = ((PyObject*)__pyx_n_s_floor);
    values[5] = ((PyObject *)__pyx_int_0);
    values[6] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_values);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          if (value) { values[6] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 61, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_index = values[0];
    __pyx_v_values = values[1];
    __pyx_v_dtype = ((PyObject*)values[2]);
    __pyx_v_name = ((PyObject*)values[3]);
    __pyx_v_interpolate = ((PyObject*)values[4]);
    __pyx_v_extrapolate = values[5];
    __pyx_v_arithmetic = ((PyObject*)values[6]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 61, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtype), (&PyString_Type), 1, "dtype", 1))) __PYX_ERR(1, 61, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), (&PyString_Type), 1, "name", 1))) __PYX_ERR(1, 62, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(1, 62, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(1, 63, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series___init__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), __pyx_v_index, __pyx_v_values, __pyx_v_dtype, __pyx_v_name, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series___init__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_values, PyObject *__pyx_v_dtype, PyObject *__pyx_v_name, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __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;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "redblackpy/series/tree_series.pyx":71
 *         :param string interpolate - interpolation method.
 *         """
 *         self.dtype = dtype             # <<<<<<<<<<<<<<
 *         self.name = name
 * 
 */
  __Pyx_INCREF(__pyx_v_dtype);
  __Pyx_GIVEREF(__pyx_v_dtype);
  __Pyx_GOTREF(__pyx_v_self->dtype);
  __Pyx_DECREF(__pyx_v_self->dtype);
  __pyx_v_self->dtype = __pyx_v_dtype;

  /* "redblackpy/series/tree_series.pyx":72
 *         """
 *         self.dtype = dtype
 *         self.name = name             # <<<<<<<<<<<<<<
 * 
 *         if self.dtype == 'uint8':
 */
  __Pyx_INCREF(__pyx_v_name);
  __Pyx_GIVEREF(__pyx_v_name);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = __pyx_v_name;

  /* "redblackpy/series/tree_series.pyx":74
 *         self.name = name
 * 
 *         if self.dtype == 'uint8':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                               index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 74, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":75
 * 
 *         if self.dtype == 'uint8':
 *             self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                               index, values, name,
 *                                                               interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 75, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":74
 *         self.name = name
 * 
 *         if self.dtype == 'uint8':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                               index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":80
 *                                                               arithmetic )
 * 
 *         elif self.dtype == 'uint16':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                                index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint16, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 80, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":81
 * 
 *         elif self.dtype == 'uint16':
 *             self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                                index, values, name,
 *                                                                interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 81, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 81, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 81, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":80
 *                                                               arithmetic )
 * 
 *         elif self.dtype == 'uint16':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                                index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":86
 *                                                                arithmetic  )
 * 
 *         elif self.dtype == 'uint32':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t, index,
 *                                                                values, name, interpolate,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 86, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":87
 * 
 *         elif self.dtype == 'uint32':
 *             self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t, index,             # <<<<<<<<<<<<<<
 *                                                                values, name, interpolate,
 *                                                                extrapolate, arithmetic  )
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 87, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 87, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 87, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":86
 *                                                                arithmetic  )
 * 
 *         elif self.dtype == 'uint32':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t, index,
 *                                                                values, name, interpolate,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":91
 *                                                                extrapolate, arithmetic  )
 * 
 *         elif self.dtype == 'uint64':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t, index,
 *                                                                values, name, interpolate,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 91, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":92
 * 
 *         elif self.dtype == 'uint64':
 *             self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t, index,             # <<<<<<<<<<<<<<
 *                                                                values, name, interpolate,
 *                                                                extrapolate, arithmetic  )
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 92, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":91
 *                                                                extrapolate, arithmetic  )
 * 
 *         elif self.dtype == 'uint64':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t, index,
 *                                                                values, name, interpolate,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":96
 *                                                                extrapolate, arithmetic  )
 * 
 *         elif self.dtype == 'uint96':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                                index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint96, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 96, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":97
 * 
 *         elif self.dtype == 'uint96':
 *             self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                                index, values, name,
 *                                                                interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 97, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 97, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 97, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":96
 *                                                                extrapolate, arithmetic  )
 * 
 *         elif self.dtype == 'uint96':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                                index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":102
 *                                                                arithmetic  )
 * 
 *         elif self.dtype == 'uint128':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                                 index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 102, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":103
 * 
 *         elif self.dtype == 'uint128':
 *             self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                                 index, values, name,
 *                                                                 interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 103, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 103, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 103, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":102
 *                                                                arithmetic  )
 * 
 *         elif self.dtype == 'uint128':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                                 index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":108
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'int8':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                              index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int8, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 108, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":109
 * 
 *         elif self.dtype == 'int8':
 *             self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                              index, values, name,
 *                                                              interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 109, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 109, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 109, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":108
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'int8':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                              index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":114
 *                                                              arithmetic  )
 * 
 *         elif self.dtype == 'int16':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                               index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int16, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 114, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":115
 * 
 *         elif self.dtype == 'int16':
 *             self.dtype_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                               index, values, name,
 *                                                               interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 115, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":114
 *                                                              arithmetic  )
 * 
 *         elif self.dtype == 'int16':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                               index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":120
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int32':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                               index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 120, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":121
 * 
 *         elif self.dtype == 'int32':
 *             self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                               index, values, name,
 *                                                               interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 121, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 121, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 121, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":120
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int32':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                               index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":126
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int64':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                               index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":127
 * 
 *         elif self.dtype == 'int64':
 *             self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                               index, values, name,
 *                                                               interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 127, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 127, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 127, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":126
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int64':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                               index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":132
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int96':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                               index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int96, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 132, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":133
 * 
 *         elif self.dtype == 'int96':
 *             self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                               index, values, name,
 *                                                               interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 133, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 133, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":132
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int96':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                               index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":138
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int128':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                                index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 138, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":139
 * 
 *         elif self.dtype == 'int128':
 *             self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                                index, values, name,
 *                                                                interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 139, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 139, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":138
 *                                                               arithmetic  )
 * 
 *         elif self.dtype == 'int128':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                                index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":144
 *                                                                arithmetic  )
 * 
 *         elif self.dtype == 'float32':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                                 index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 144, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":145
 * 
 *         elif self.dtype == 'float32':
 *             self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                                 index, values, name,
 *                                                                 interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 145, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 145, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 145, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":144
 *                                                                arithmetic  )
 * 
 *         elif self.dtype == 'float32':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                                 index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":150
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float64':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                                 index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 150, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":151
 * 
 *         elif self.dtype == 'float64':
 *             self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                                 index, values, name,
 *                                                                 interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 151, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 151, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":150
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float64':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                                 index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":156
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float80':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                                 index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float80, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 156, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":157
 * 
 *         elif self.dtype == 'float80':
 *             self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                                 index, values, name,
 *                                                                 interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 157, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 157, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":156
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float80':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                                 index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":162
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float96':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                                 index, values, name,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float96, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 162, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":163
 * 
 *         elif self.dtype == 'float96':
 *             self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                                 index, values, name,
 *                                                                 interpolate, extrapolate,
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 163, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 163, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":162
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float96':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                                 index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":168
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float128':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                                  index, values, name,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 168, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":169
 * 
 *         elif self.dtype == 'float128':
 *             self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                                  index, values, name,
 *                                                                  interpolate, extrapolate,
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 169, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 169, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 169, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":168
 *                                                                 arithmetic  )
 * 
 *         elif self.dtype == 'float128':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                                  index, values, name,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":174
 *                                                                  arithmetic  )
 * 
 *         elif self.dtype == 'object':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object, index,
 *                                                              values, name, interpolate,
 */
  __pyx_t_2 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_object, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 174, __pyx_L1_error)
  __pyx_t_1 = (__pyx_t_2 != 0);
  if (__pyx_t_1) {

    /* "redblackpy/series/tree_series.pyx":175
 * 
 *         elif self.dtype == 'object':
 *             self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object, index,             # <<<<<<<<<<<<<<
 *                                                              values, name, interpolate,
 *                                                              extrapolate, arithmetic )
 */
    __pyx_t_4 = PyTuple_New(6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_4, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_4, 5, __pyx_v_arithmetic);
    __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_t_4, NULL)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 175, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 175, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
    __pyx_t_3 = 0;

    /* "redblackpy/series/tree_series.pyx":174
 *                                                                  arithmetic  )
 * 
 *         elif self.dtype == 'object':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object, index,
 *                                                              values, name, interpolate,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":179
 *                                                              extrapolate, arithmetic )
 * 
 *         elif self.dtype == 'str':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object, index,
 *                                                              values, name, interpolate,
 */
  __pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 179, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (likely(__pyx_t_2)) {

    /* "redblackpy/series/tree_series.pyx":180
 * 
 *         elif self.dtype == 'str':
 *             self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object, index,             # <<<<<<<<<<<<<<
 *                                                              values, name, interpolate,
 *                                                              extrapolate, arithmetic )
 */
    __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
    __Pyx_INCREF(__pyx_v_values);
    __Pyx_GIVEREF(__pyx_v_values);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_values);
    __Pyx_INCREF(__pyx_v_name);
    __Pyx_GIVEREF(__pyx_v_name);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_name);
    __Pyx_INCREF(__pyx_v_interpolate);
    __Pyx_GIVEREF(__pyx_v_interpolate);
    PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_interpolate);
    __Pyx_INCREF(__pyx_v_extrapolate);
    __Pyx_GIVEREF(__pyx_v_extrapolate);
    PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_extrapolate);
    __Pyx_INCREF(__pyx_v_arithmetic);
    __Pyx_GIVEREF(__pyx_v_arithmetic);
    PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_v_arithmetic);
    __pyx_t_4 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_t_3, NULL)); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 180, __pyx_L1_error)
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_4), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 180, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_4);
    __Pyx_GOTREF(__pyx_v_self->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
    __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
    __pyx_t_4 = 0;

    /* "redblackpy/series/tree_series.pyx":179
 *                                                              extrapolate, arithmetic )
 * 
 *         elif self.dtype == 'str':             # <<<<<<<<<<<<<<
 *             self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object, index,
 *                                                              values, name, interpolate,
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":185
 * 
 *         else:
 *             raise TypeError( "Unsupported data type {:}".format(dtype) )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unsupported_data_type, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_dtype};
        __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_dtype};
        __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_4);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_dtype);
        __Pyx_GIVEREF(__pyx_v_dtype);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_dtype);
        __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 185, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 185, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "redblackpy/series/tree_series.pyx":61
 *     with time series.
 *     """
 *     def __init__( self, object index=None, object values=None, str dtype="float32",             # <<<<<<<<<<<<<<
 *                   str name="Untitled", str interpolate="floor", extrapolate=0,
 *                   str arithmetic="left" ):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":192
 *     #--------------------------------------------------------------------------------------------
 *     @property
 *     def interpolation(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.interpolate_type
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_13interpolation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_13interpolation_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_13interpolation___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_13interpolation___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "redblackpy/series/tree_series.pyx":194
 *     def interpolation(self):
 * 
 *         return self.dtype_series.interpolate_type             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_interpolate_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 194, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":192
 *     #--------------------------------------------------------------------------------------------
 *     @property
 *     def interpolation(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.interpolate_type
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.interpolation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":198
 * 
 *     @interpolation.setter
 *     def interpolation(self, str interpolation):             # <<<<<<<<<<<<<<
 * 
 *         self.set_interpolation(interpolation)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_13interpolation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_13interpolation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolation) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolation), (&PyString_Type), 1, "interpolation", 1))) __PYX_ERR(1, 198, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_13interpolation_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject*)__pyx_v_interpolation));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_13interpolation_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_interpolation) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "redblackpy/series/tree_series.pyx":200
 *     def interpolation(self, str interpolation):
 * 
 *         self.set_interpolation(interpolation)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->set_interpolation(__pyx_v_self, __pyx_v_interpolation, 0);

  /* "redblackpy/series/tree_series.pyx":198
 * 
 *     @interpolation.setter
 *     def interpolation(self, str interpolation):             # <<<<<<<<<<<<<<
 * 
 *         self.set_interpolation(interpolation)
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":204
 * 
 *     @property
 *     def extrapolation(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.extrapolate
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_13extrapolation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_13extrapolation_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_13extrapolation___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_13extrapolation___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "redblackpy/series/tree_series.pyx":206
 *     def extrapolation(self):
 * 
 *         return self.dtype_series.extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":204
 * 
 *     @property
 *     def extrapolation(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.extrapolate
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.extrapolation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":210
 * 
 *     @extrapolation.setter
 *     def extrapolation(self, extrapolation):             # <<<<<<<<<<<<<<
 * 
 *         self.set_extrapolation(extrapolation)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_13extrapolation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_extrapolation); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_13extrapolation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_extrapolation) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_13extrapolation_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_extrapolation));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_13extrapolation_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_extrapolation) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "redblackpy/series/tree_series.pyx":212
 *     def extrapolation(self, extrapolation):
 * 
 *         self.set_extrapolation(extrapolation)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->set_extrapolation(__pyx_v_self, __pyx_v_extrapolation, 0);

  /* "redblackpy/series/tree_series.pyx":210
 * 
 *     @extrapolation.setter
 *     def extrapolation(self, extrapolation):             # <<<<<<<<<<<<<<
 * 
 *         self.set_extrapolation(extrapolation)
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":216
 * 
 *     @property
 *     def arithmetic(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.arithmetic
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_10arithmetic_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_10arithmetic_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_10arithmetic___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_10arithmetic___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "redblackpy/series/tree_series.pyx":218
 *     def arithmetic(self):
 * 
 *         return self.dtype_series.arithmetic             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 218, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":216
 * 
 *     @property
 *     def arithmetic(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.arithmetic
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.arithmetic.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":222
 * 
 *     @arithmetic.setter
 *     def arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         self.set_arithmetic(arithmetic)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_10arithmetic_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(1, 222, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_10arithmetic_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_10arithmetic_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "redblackpy/series/tree_series.pyx":224
 *     def arithmetic(self, str arithmetic):
 * 
 *         self.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 0);

  /* "redblackpy/series/tree_series.pyx":222
 * 
 *     @arithmetic.setter
 *     def arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 * 
 *         self.set_arithmetic(arithmetic)
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":231
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef void insert(self, key, value) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert new value at key to series.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_3insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_insert(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_3insert)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_value};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_key, __pyx_v_value};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
        __Pyx_INCREF(__pyx_v_value);
        __Pyx_GIVEREF(__pyx_v_value);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":236
 *         Complexity O(log n).
 *         """
 *         self.dtype_series.insert(key, value)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_insert); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_value);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 236, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":231
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef void insert(self, key, value) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert new value at key to series.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_3insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_2insert[] = "Series.insert(self, key, value) -> void\n\n        Insert new value at key to series.\n        Complexity O(log n).\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_3insert = {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_3insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_2insert};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_3insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_key = 0;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_key,&__pyx_n_s_value,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_key)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_value)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, 1); __PYX_ERR(1, 231, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "insert") < 0)) __PYX_ERR(1, 231, __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_value = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("insert", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 231, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_2insert(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), __pyx_v_key, __pyx_v_value);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_2insert(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_6Series_insert(__pyx_v_self, __pyx_v_key, __pyx_v_value, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 231, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 231, __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("redblackpy.series.tree_series.Series.insert", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":240
 * 
 *     @cython.embedsignature(True)
 *     cpdef void insert_range(self, pairs) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert list of tuples (key, value) to series.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_5insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_pairs, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_5insert_range)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_pairs); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_pairs};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_pairs);
          __Pyx_GIVEREF(__pyx_v_pairs);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":244
 *         Insert list of tuples (key, value) to series.
 *         """
 *         self.dtype_series.insert_range(pairs)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_insert_range); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_pairs); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_pairs};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_pairs};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_pairs);
      __Pyx_GIVEREF(__pyx_v_pairs);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_pairs);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 244, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":240
 * 
 *     @cython.embedsignature(True)
 *     cpdef void insert_range(self, pairs) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert list of tuples (key, value) to series.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_5insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_4insert_range[] = "Series.insert_range(self, pairs) -> void\n\n        Insert list of tuples (key, value) to series.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_5insert_range = {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_5insert_range, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_4insert_range};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_5insert_range(PyObject *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("insert_range (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_4insert_range(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_pairs));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_4insert_range(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_pairs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("insert_range", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_6Series_insert_range(__pyx_v_self, __pyx_v_pairs, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 240, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __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("redblackpy.series.tree_series.Series.insert_range", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":248
 * 
 *     @cython.embedsignature(True)
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Erase element by key.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_7erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_erase(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_erase); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_7erase)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":253
 *         Complexity O(log n).
 *         """
 *         self.dtype_series.erase(key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_erase); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":248
 * 
 *     @cython.embedsignature(True)
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Erase element by key.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_7erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_6erase[] = "Series.erase(self, key) -> void\n\n        Erase element by key.\n        Complexity O(log n).\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_7erase = {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_7erase, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_6erase};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_7erase(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("erase (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_6erase(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_6erase(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("erase", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_6Series_erase(__pyx_v_self, __pyx_v_key, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 248, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 248, __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("redblackpy.series.tree_series.Series.erase", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":257
 * 
 *     @cython.embedsignature(True)
 *     cpdef begin(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns first key.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_9begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_begin(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("begin", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_begin); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_9begin)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 257, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 257, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":261
 *         Returns first key.
 *         """
 *         return self.dtype_series.begin()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self->dtype_series->__pyx_vtab)->begin(__pyx_v_self->dtype_series, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 261, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":257
 * 
 *     @cython.embedsignature(True)
 *     cpdef begin(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns first key.
 */

  /* 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("redblackpy.series.tree_series.Series.begin", __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_10redblackpy_6series_11tree_series_6Series_9begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_8begin[] = "Series.begin(self)\n\n        Returns first key.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_9begin = {"begin", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_9begin, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_8begin};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_9begin(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("begin (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_8begin(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_8begin(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("begin", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_begin(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 257, __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("redblackpy.series.tree_series.Series.begin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":265
 * 
 *     @cython.embedsignature(True)
 *     cpdef end(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns last key.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_11end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_end(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("end", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_end); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_11end)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 265, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 265, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":269
 *         Returns last key.
 *         """
 *         return self.dtype_series.end()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self->dtype_series->__pyx_vtab)->end(__pyx_v_self->dtype_series, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":265
 * 
 *     @cython.embedsignature(True)
 *     cpdef end(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns last key.
 */

  /* 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("redblackpy.series.tree_series.Series.end", __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_10redblackpy_6series_11tree_series_6Series_11end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_10end[] = "Series.end(self)\n\n        Returns last key.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_11end = {"end", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_11end, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_10end};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_11end(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("end (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_10end(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_10end(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("end", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_end(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 265, __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("redblackpy.series.tree_series.Series.end", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":273
 * 
 *     @cython.embedsignature(True)
 *     cpdef list index(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of keys.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_13index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_index(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("index", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_index); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_13index)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 273, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 273, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 273, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":277
 *         Returns list of keys.
 *         """
 *         return self.dtype_series.keys()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self->dtype_series->__pyx_vtab)->keys(__pyx_v_self->dtype_series, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":273
 * 
 *     @cython.embedsignature(True)
 *     cpdef list index(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of keys.
 */

  /* 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("redblackpy.series.tree_series.Series.index", __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_10redblackpy_6series_11tree_series_6Series_13index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_12index[] = "Series.index(self) -> list\n\n        Returns list of keys.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_13index = {"index", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_13index, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_12index};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_13index(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("index (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_12index(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_12index(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("index", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_index(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 273, __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("redblackpy.series.tree_series.Series.index", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":280
 * 
 * 
 *     cdef rb_tree_ptr get_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tree pointer.
 */

static __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_f_10redblackpy_6series_11tree_series_6Series_get_tree(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  __pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("get_tree", 0);

  /* "redblackpy/series/tree_series.pyx":284
 *         Returns tree pointer.
 *         """
 *         return self.dtype_series.get_tree()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree(__pyx_v_self->dtype_series);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":280
 * 
 * 
 *     cdef rb_tree_ptr get_tree(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tree pointer.
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":288
 * 
 *     @cython.embedsignature(True)
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of values.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_15values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_values(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("values", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_values); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_15values)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 288, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":292
 *         Returns list of values.
 *         """
 *         return self.dtype_series.values()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_values); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 292, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 292, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":288
 * 
 *     @cython.embedsignature(True)
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of values.
 */

  /* 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("redblackpy.series.tree_series.Series.values", __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_10redblackpy_6series_11tree_series_6Series_15values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_14values[] = "Series.values(self) -> list\n\n        Returns list of values.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_15values = {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_15values, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_14values};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_15values(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("values (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_14values(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_14values(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("values", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_values(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 288, __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("redblackpy.series.tree_series.Series.values", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":296
 * 
 *     @cython.embedsignature(True)
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of tuples(key, value).
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_17items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_items(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, 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;
  __Pyx_RefNannySetupContext("items", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_17items)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 296, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 296, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyList_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 296, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":300
 *         Returns list of tuples(key, value).
 *         """
 *         return self.dtype_series.items()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_items); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 300, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 300, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyList_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "list", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 300, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":296
 * 
 *     @cython.embedsignature(True)
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of tuples(key, value).
 */

  /* 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("redblackpy.series.tree_series.Series.items", __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_10redblackpy_6series_11tree_series_6Series_17items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_16items[] = "Series.items(self) -> list\n\n        Returns list of tuples(key, value).\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_17items = {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_17items, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_16items};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_17items(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("items (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_16items(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_16items(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("items", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_items(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 296, __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("redblackpy.series.tree_series.Series.items", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":303
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns generator of tuples(key, value).
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_19iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_18iteritems[] = "Series.iteritems(self)\n\n        Returns generator of tuples(key, value).\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_19iteritems = {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_19iteritems, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_18iteritems};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_19iteritems(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("iteritems (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_18iteritems(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_18iteritems(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("iteritems", 0);

  /* "redblackpy/series/tree_series.pyx":307
 *         Returns generator of tuples(key, value).
 *         """
 *         return self.dtype_series.iteritems()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_iteritems); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 307, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 307, __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;

  /* "redblackpy/series/tree_series.pyx":303
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns generator of tuples(key, value).
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.iteritems", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":311
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key' <= key
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_21floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_floor(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, 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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_floor); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 311, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_21floor)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 311, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 311, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 311, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 311, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 311, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 311, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":316
 *         and series does not contain key'', key' < key'' <= key.
 *         """
 *         return self.dtype_series.floor(key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 316, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 316, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":311
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key' <= key
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.floor", __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_10redblackpy_6series_11tree_series_6Series_21floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_20floor[] = "Series.floor(self, key) -> tuple\n\n        Returns tuple (key', value') such that key' <= key \n        and series does not contain key'', key' < key'' <= key.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_21floor = {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_21floor, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_20floor};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_21floor(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("floor (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_20floor(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_20floor(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("floor", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_floor(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 311, __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("redblackpy.series.tree_series.Series.floor", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":320
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key <= key'
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_23ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_ceil(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, 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;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_23ceil)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_key};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 320, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_key);
          __Pyx_GIVEREF(__pyx_v_key);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(PyTuple_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_2)->tp_name), 0))) __PYX_ERR(1, 320, __pyx_L1_error)
      __pyx_r = ((PyObject*)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":325
 *         and series does not contain key'', key <= key'' < key'.
 *         """
 *         return self.dtype_series.ceil(key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_ceil); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 325, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(likely(PyTuple_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 325, __pyx_L1_error)
  __pyx_r = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":320
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key <= key'
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.ceil", __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_10redblackpy_6series_11tree_series_6Series_23ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_22ceil[] = "Series.ceil(self, key) -> tuple\n\n        Returns tuple (key', value') such that key <= key' \n        and series does not contain key'', key <= key'' < key'.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_23ceil = {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_23ceil, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_22ceil};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_23ceil(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("ceil (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_22ceil(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_22ceil(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("ceil", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_ceil(__pyx_v_self, __pyx_v_key, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 320, __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("redblackpy.series.tree_series.Series.ceil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":329
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series truncate(self, start, stop):             # <<<<<<<<<<<<<<
 *         """
 *         Truncation from start until stop.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_25truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_f_10redblackpy_6series_11tree_series_6Series_truncate(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 329, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_25truncate)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series_Series))))) __PYX_ERR(1, 329, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":333
 *         Truncation from start until stop.
 *         """
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->dtype) < 0) __PYX_ERR(1, 333, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":334
 *         """
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 334, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":335
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":336
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = self.dtype_series.truncate(start, stop)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":333
 *         Truncation from start until stop.
 *         """
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":338
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = self.dtype_series.truncate(start, stop)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_truncate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_start, __pyx_v_stop};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_start, __pyx_v_stop};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_start);
    __Pyx_GIVEREF(__pyx_v_start);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
    __Pyx_INCREF(__pyx_v_stop);
    __Pyx_GIVEREF(__pyx_v_stop);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 338, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 338, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":340
 *         result.dtype_series = self.dtype_series.truncate(start, stop)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":329
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series truncate(self, start, stop):             # <<<<<<<<<<<<<<
 *         """
 *         Truncation from start until stop.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_25truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_24truncate[] = "Series.truncate(self, start, stop) -> Series\n\n        Truncation from start until stop.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_25truncate = {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_25truncate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_24truncate};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_25truncate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("truncate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, 1); __PYX_ERR(1, 329, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "truncate") < 0)) __PYX_ERR(1, 329, __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_start = values[0];
    __pyx_v_stop = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("truncate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 329, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_24truncate(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), __pyx_v_start, __pyx_v_stop);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_24truncate(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("truncate", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_6Series_truncate(__pyx_v_self, __pyx_v_start, __pyx_v_stop, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 329, __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("redblackpy.series.tree_series.Series.truncate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":344
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series uniform(self, start, stop, step):             # <<<<<<<<<<<<<<
 *         """
 *         Returns uniform grid Series from start until stop
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_27uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_f_10redblackpy_6series_11tree_series_6Series_uniform(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step, int __pyx_skip_dispatch) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("uniform", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_uniform); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_27uniform)) {
      __Pyx_XDECREF(((PyObject *)__pyx_r));
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      __pyx_t_5 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_5 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_GOTREF(__pyx_t_2);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 344, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        if (__pyx_t_4) {
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
        }
        __Pyx_INCREF(__pyx_v_start);
        __Pyx_GIVEREF(__pyx_v_start);
        PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
        __Pyx_INCREF(__pyx_v_stop);
        __Pyx_GIVEREF(__pyx_v_stop);
        PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
        __Pyx_INCREF(__pyx_v_step);
        __Pyx_GIVEREF(__pyx_v_step);
        PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series_Series))))) __PYX_ERR(1, 344, __pyx_L1_error)
      __pyx_r = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":349
 *         with step equals step.
 *         """
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->dtype) < 0) __PYX_ERR(1, 349, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":350
 *         """
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":351
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":352
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = self.dtype_series.periodic(start, stop, step)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":349
 *         with step equals step.
 *         """
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":354
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = self.dtype_series.periodic(start, stop, step)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_periodic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_start, __pyx_v_stop, __pyx_v_step};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_start);
    __Pyx_GIVEREF(__pyx_v_start);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_start);
    __Pyx_INCREF(__pyx_v_stop);
    __Pyx_GIVEREF(__pyx_v_stop);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_stop);
    __Pyx_INCREF(__pyx_v_step);
    __Pyx_GIVEREF(__pyx_v_step);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_step);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 354, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 354, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":356
 *         result.dtype_series = self.dtype_series.periodic(start, stop, step)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":344
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series uniform(self, start, stop, step):             # <<<<<<<<<<<<<<
 *         """
 *         Returns uniform grid Series from start until stop
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.uniform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_27uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_26uniform[] = "Series.uniform(self, start, stop, step) -> Series\n\n        Returns uniform grid Series from start until stop\n        with step equals step.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_27uniform = {"uniform", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_27uniform, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_26uniform};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_27uniform(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start = 0;
  PyObject *__pyx_v_stop = 0;
  PyObject *__pyx_v_step = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("uniform (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,&__pyx_n_s_step,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("uniform", 1, 3, 3, 1); __PYX_ERR(1, 344, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_step)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("uniform", 1, 3, 3, 2); __PYX_ERR(1, 344, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "uniform") < 0)) __PYX_ERR(1, 344, __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_start = values[0];
    __pyx_v_stop = values[1];
    __pyx_v_step = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("uniform", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 344, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.uniform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_26uniform(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), __pyx_v_start, __pyx_v_stop, __pyx_v_step);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_26uniform(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop, PyObject *__pyx_v_step) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("uniform", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_10redblackpy_6series_11tree_series_6Series_uniform(__pyx_v_self, __pyx_v_start, __pyx_v_stop, __pyx_v_step, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 344, __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("redblackpy.series.tree_series.Series.uniform", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":360
 * 
 *     @cython.embedsignature(True)
 *     cpdef map(self, method, bint inplace=False, tuple args=(), dict kwargs={}):             # <<<<<<<<<<<<<<
 *         """
 *         Apply method to each value in series.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_29map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_map(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map *__pyx_optional_args) {
  int __pyx_v_inplace = ((int)0);
  PyObject *__pyx_v_args = ((PyObject*)__pyx_empty_tuple);
  PyObject *__pyx_v_kwargs = __pyx_k__187;
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("map", 0);
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_inplace = __pyx_optional_args->inplace;
      if (__pyx_optional_args->__pyx_n > 1) {
        __pyx_v_args = __pyx_optional_args->args;
        if (__pyx_optional_args->__pyx_n > 2) {
          __pyx_v_kwargs = __pyx_optional_args->kwargs;
        }
      }
    }
  }
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_29map)) {
      __Pyx_XDECREF(__pyx_r);
      __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_inplace); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 360, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_4 = __pyx_t_1; __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_method, __pyx_t_3, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[5] = {__pyx_t_5, __pyx_v_method, __pyx_t_3, __pyx_v_args, __pyx_v_kwargs};
        __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_6, 4+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(4+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 360, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_v_method);
        __Pyx_GIVEREF(__pyx_v_method);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_method);
        __Pyx_GIVEREF(__pyx_t_3);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_3);
        __Pyx_INCREF(__pyx_v_args);
        __Pyx_GIVEREF(__pyx_v_args);
        PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_args);
        __Pyx_INCREF(__pyx_v_kwargs);
        __Pyx_GIVEREF(__pyx_v_kwargs);
        PyTuple_SET_ITEM(__pyx_t_7, 3+__pyx_t_6, __pyx_v_kwargs);
        __pyx_t_3 = 0;
        __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":364
 *         Apply method to each value in series.
 *         """
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_v_self->dtype) < 0) __PYX_ERR(1, 364, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":365
 *         """
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 365, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":366
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 *         if inplace:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":367
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *         if inplace:
 *             self.dtype_series.map_inplace(method, args, kwargs)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":364
 *         Apply method to each value in series.
 *         """
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 364, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":368
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 *         if inplace:             # <<<<<<<<<<<<<<
 *             self.dtype_series.map_inplace(method, args, kwargs)
 * 
 */
  __pyx_t_8 = (__pyx_v_inplace != 0);
  if (__pyx_t_8) {

    /* "redblackpy/series/tree_series.pyx":369
 *                                      arithmetic=self.arithmetic )
 *         if inplace:
 *             self.dtype_series.map_inplace(method, args, kwargs)             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_map_inplace); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 369, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 369, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 369, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_INCREF(__pyx_v_method);
      __Pyx_GIVEREF(__pyx_v_method);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_v_method);
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_v_args);
      __Pyx_INCREF(__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_7, 2+__pyx_t_6, __pyx_v_kwargs);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 369, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "redblackpy/series/tree_series.pyx":368
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 *         if inplace:             # <<<<<<<<<<<<<<
 *             self.dtype_series.map_inplace(method, args, kwargs)
 * 
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":372
 * 
 *         else:
 *             result.dtype_series = self.dtype_series.map(method, args, kwargs)             # <<<<<<<<<<<<<<
 * 
 *             return result
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_map); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_v_method, __pyx_v_args, __pyx_v_kwargs};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 3+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(3+__pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_v_method);
      __Pyx_GIVEREF(__pyx_v_method);
      PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_6, __pyx_v_method);
      __Pyx_INCREF(__pyx_v_args);
      __Pyx_GIVEREF(__pyx_v_args);
      PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_6, __pyx_v_args);
      __Pyx_INCREF(__pyx_v_kwargs);
      __Pyx_GIVEREF(__pyx_v_kwargs);
      PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_6, __pyx_v_kwargs);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 372, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 372, __pyx_L1_error)
    __Pyx_GIVEREF(__pyx_t_2);
    __Pyx_GOTREF(__pyx_v_result->dtype_series);
    __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
    __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
    __pyx_t_2 = 0;

    /* "redblackpy/series/tree_series.pyx":374
 *             result.dtype_series = self.dtype_series.map(method, args, kwargs)
 * 
 *             return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = ((PyObject *)__pyx_v_result);
    goto __pyx_L0;
  }
  __pyx_L3:;

  /* "redblackpy/series/tree_series.pyx":360
 * 
 *     @cython.embedsignature(True)
 *     cpdef map(self, method, bint inplace=False, tuple args=(), dict kwargs={}):             # <<<<<<<<<<<<<<
 *         """
 *         Apply method to each value in series.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_29map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_28map[] = "Series.map(self, method, bool inplace=False, tuple args=(), dict kwargs={})\n\n        Apply method to each value in series.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_29map = {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_29map, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_28map};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_29map(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_method = 0;
  int __pyx_v_inplace;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("map (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_method,&__pyx_n_s_inplace,&__pyx_n_s_args,&__pyx_n_s_kwargs,0};
    PyObject* values[4] = {0,0,0,0};
    values[2] = ((PyObject*)__pyx_empty_tuple);
    values[3] = __pyx_k__187;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_method)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_inplace);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_args);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_kwargs);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "map") < 0)) __PYX_ERR(1, 360, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_method = values[0];
    if (values[1]) {
      __pyx_v_inplace = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_inplace == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 360, __pyx_L3_error)
    } else {
      __pyx_v_inplace = ((int)0);
    }
    __pyx_v_args = ((PyObject*)values[2]);
    __pyx_v_kwargs = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("map", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_args), (&PyTuple_Type), 1, "args", 1))) __PYX_ERR(1, 360, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_kwargs), (&PyDict_Type), 1, "kwargs", 1))) __PYX_ERR(1, 360, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_28map(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), __pyx_v_method, __pyx_v_inplace, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_28map(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_method, int __pyx_v_inplace, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map __pyx_t_2;
  __Pyx_RefNannySetupContext("map", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2.__pyx_n = 3;
  __pyx_t_2.inplace = __pyx_v_inplace;
  __pyx_t_2.args = __pyx_v_args;
  __pyx_t_2.kwargs = __pyx_v_kwargs;
  __pyx_t_1 = __pyx_vtabptr_10redblackpy_6series_11tree_series_Series->map(__pyx_v_self, __pyx_v_method, 1, &__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 360, __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("redblackpy.series.tree_series.Series.map", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":378
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_31set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_interpolate, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_31set_interpolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_interpolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 378, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 378, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_interpolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 378, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_interpolate);
          __Pyx_GIVEREF(__pyx_v_interpolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 378, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":383
 *         Supports ceil, floor, nn, linear.
 *         """
 *         self.dtype_series.set_interpolation(interpolate)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_set_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_interpolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 383, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_interpolate};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 383, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_interpolate};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 383, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_interpolate);
      __Pyx_GIVEREF(__pyx_v_interpolate);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_interpolate);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 383, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":378
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.Series.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_31set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_30set_interpolation[] = "Series.set_interpolation(self, str interpolate) -> void\n\n        Set interpolation type.\n        Supports ceil, floor, nn, linear.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_31set_interpolation = {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_31set_interpolation, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_30set_interpolation};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_31set_interpolation(PyObject *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_interpolation (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(1, 378, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_30set_interpolation(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject*)__pyx_v_interpolate));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_30set_interpolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_interpolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_interpolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_6Series_set_interpolation(__pyx_v_self, __pyx_v_interpolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 378, __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("redblackpy.series.tree_series.Series.set_interpolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":387
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_extrapolation(self, extrapolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_33set_extrapolation(PyObject *__pyx_v_self, PyObject *__pyx_v_extrapolate); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_set_extrapolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_extrapolate, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("set_extrapolation", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 387, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_33set_extrapolation)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_extrapolate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_extrapolate};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_extrapolate};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_extrapolate);
          __Pyx_GIVEREF(__pyx_v_extrapolate);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_extrapolate);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":392
 *         Supports ceil, floor, nn, linear.
 *         """
 *         self.dtype_series.extrapolate = extrapolate             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_extrapolate, __pyx_v_extrapolate) < 0) __PYX_ERR(1, 392, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":387
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_extrapolation(self, extrapolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.Series.set_extrapolation", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_33set_extrapolation(PyObject *__pyx_v_self, PyObject *__pyx_v_extrapolate); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_32set_extrapolation[] = "Series.set_extrapolation(self, extrapolate) -> void\n\n        Set interpolation type.\n        Supports ceil, floor, nn, linear.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_33set_extrapolation = {"set_extrapolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_33set_extrapolation, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_32set_extrapolation};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_33set_extrapolation(PyObject *__pyx_v_self, PyObject *__pyx_v_extrapolate) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_extrapolation (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_32set_extrapolation(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_extrapolate));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_32set_extrapolation(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_extrapolate) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_extrapolation", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_6Series_set_extrapolation(__pyx_v_self, __pyx_v_extrapolate, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 387, __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("redblackpy.series.tree_series.Series.set_extrapolation", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":396
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_35set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_arithmetic, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 396, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_35set_arithmetic)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_arithmetic};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_arithmetic);
          __Pyx_GIVEREF(__pyx_v_arithmetic);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":401
 *         Supports ceil, floor, nn, linear.
 *         """
 *         self.dtype_series.set_arithmetic(arithmetic)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_set_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_arithmetic};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_arithmetic};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_arithmetic);
      __Pyx_GIVEREF(__pyx_v_arithmetic);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_arithmetic);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 401, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":396
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.Series.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_35set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_34set_arithmetic[] = "Series.set_arithmetic(self, str arithmetic) -> void\n\n        Set interpolation type.\n        Supports ceil, floor, nn, linear.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_35set_arithmetic = {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_35set_arithmetic, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_34set_arithmetic};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_35set_arithmetic(PyObject *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_arithmetic (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(1, 396, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_34set_arithmetic(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject*)__pyx_v_arithmetic));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_34set_arithmetic(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_arithmetic) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("set_arithmetic", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_6Series_set_arithmetic(__pyx_v_self, __pyx_v_arithmetic, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 396, __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("redblackpy.series.tree_series.Series.set_arithmetic", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":405
 * 
 *     @cython.embedsignature(True)
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn on linear search for operator[].
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_37on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_on_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 405, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_37on_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 405, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 405, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":409
 *         Turn on linear search for operator[].
 *         """
 *         self.dtype_series.on_itermode()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self->dtype_series->__pyx_vtab)->on_itermode(__pyx_v_self->dtype_series, 0);

  /* "redblackpy/series/tree_series.pyx":405
 * 
 *     @cython.embedsignature(True)
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn on linear search for operator[].
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.Series.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_37on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_36on_itermode[] = "Series.on_itermode(self) -> void\n\n        Turn on linear search for operator[].\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_37on_itermode = {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_37on_itermode, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_36on_itermode};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_37on_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("on_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_36on_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_36on_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("on_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_6Series_on_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 405, __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("redblackpy.series.tree_series.Series.on_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":413
 * 
 *     @cython.embedsignature(True)
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn off linear search for operator[].
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_39off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch) {
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_off_itermode); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 413, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_39off_itermode)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":417
 *         Turn off linear search for operator[].
 *         """
 *         self.dtype_series.off_itermode()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_v_self->dtype_series->__pyx_vtab)->off_itermode(__pyx_v_self->dtype_series, 0);

  /* "redblackpy/series/tree_series.pyx":413
 * 
 *     @cython.embedsignature(True)
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn off linear search for operator[].
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("redblackpy.series.tree_series.Series.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_39off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_38off_itermode[] = "Series.off_itermode(self) -> void\n\n        Turn off linear search for operator[].\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_39off_itermode = {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_39off_itermode, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_38off_itermode};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_39off_itermode(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("off_itermode (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_38off_itermode(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_38off_itermode(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("off_itermode", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_10redblackpy_6series_11tree_series_6Series_off_itermode(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 413, __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("redblackpy.series.tree_series.Series.off_itermode", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":421
 * 
 *     @cython.embedsignature(True)
 *     cpdef void cast_dtype(self, str dtype) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to specific dtype.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_41cast_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_dtype); /*proto*/
static void __pyx_f_10redblackpy_6series_11tree_series_6Series_cast_dtype(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_dtype, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_new_series = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("cast_dtype", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cast_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 421, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_41cast_dtype)) {
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype};
          __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_dtype};
          __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
          __Pyx_GOTREF(__pyx_t_2);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
          __Pyx_INCREF(__pyx_v_dtype);
          __Pyx_GIVEREF(__pyx_v_dtype);
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_dtype);
          __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":425
 *         Cast values to specific dtype.
 *         """
 *         self.dtype = dtype             # <<<<<<<<<<<<<<
 * 
 *         if self.dtype == 'uint8':
 */
  __Pyx_INCREF(__pyx_v_dtype);
  __Pyx_GIVEREF(__pyx_v_dtype);
  __Pyx_GOTREF(__pyx_v_self->dtype);
  __Pyx_DECREF(__pyx_v_self->dtype);
  __pyx_v_self->dtype = __pyx_v_dtype;

  /* "redblackpy/series/tree_series.pyx":427
 *         self.dtype = dtype
 * 
 *         if self.dtype == 'uint8':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint8, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 427, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":429
 *         if self.dtype == 'uint8':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                                   name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":431
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                                   name=self.name,             # <<<<<<<<<<<<<<
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 431, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 431, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":432
 *                 self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 432, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 431, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":433
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                   arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 433, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 431, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":434
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 434, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 431, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":430
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 430, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 430, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":429
 *         if self.dtype == 'uint8':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                                   name=self.name,
 */
      goto __pyx_L4;
    }

    /* "redblackpy/series/tree_series.pyx":437
 * 
 *             else:
 *                 new_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":438
 *             else:
 *                 new_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                            name=self.name,             # <<<<<<<<<<<<<<
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 438, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 438, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":439
 *                 new_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 439, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 438, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":440
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 440, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 438, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":441
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 438, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":437
 * 
 *             else:
 *                 new_series = __TreeSeries_uint8_t.__new__( __TreeSeries_uint8_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 437, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":442
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 442, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 442, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 442, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":443
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 443, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 443, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":444
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 444, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L4:;

    /* "redblackpy/series/tree_series.pyx":427
 *         self.dtype = dtype
 * 
 *         if self.dtype == 'uint8':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":447
 * 
 * 
 *         elif self.dtype == 'uint16':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint16, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 447, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":449
 *         elif self.dtype == 'uint16':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                                    name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":451
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                                    name=self.name,             # <<<<<<<<<<<<<<
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 451, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":452
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 452, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 451, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":453
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                    arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 453, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 451, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":454
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 454, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 451, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":450
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 450, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 450, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":449
 *         elif self.dtype == 'uint16':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                                    name=self.name,
 */
      goto __pyx_L5;
    }

    /* "redblackpy/series/tree_series.pyx":457
 * 
 *             else:
 *                 new_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":458
 *             else:
 *                 new_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                             name=self.name,             # <<<<<<<<<<<<<<
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 458, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 458, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":459
 *                 new_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 459, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 458, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":460
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 460, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 458, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":461
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 458, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":457
 * 
 *             else:
 *                 new_series = __TreeSeries_uint16_t.__new__( __TreeSeries_uint16_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 457, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":462
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 462, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 462, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 462, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 462, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 462, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":463
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 463, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 463, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":464
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'uint32':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 464, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L5:;

    /* "redblackpy/series/tree_series.pyx":447
 * 
 * 
 *         elif self.dtype == 'uint16':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":466
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint32':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint32, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 466, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":468
 *         elif self.dtype == 'uint32':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                                    name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":470
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                                    name=self.name,             # <<<<<<<<<<<<<<
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 470, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 470, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":471
 *                 self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 471, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 470, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":472
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                    arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 472, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 470, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":473
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 473, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 470, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":469
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 469, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 469, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":468
 *         elif self.dtype == 'uint32':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                                    name=self.name,
 */
      goto __pyx_L6;
    }

    /* "redblackpy/series/tree_series.pyx":476
 * 
 *             else:
 *                 new_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":477
 *             else:
 *                 new_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                             name=self.name,             # <<<<<<<<<<<<<<
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 477, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 477, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":478
 *                 new_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 478, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 477, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":479
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 479, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 477, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":480
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 480, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 477, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":476
 * 
 *             else:
 *                 new_series = __TreeSeries_uint32_t.__new__( __TreeSeries_uint32_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 476, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":481
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 481, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 481, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 481, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 481, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 481, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":482
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 482, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 482, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":483
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'uint64':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 483, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L6:;

    /* "redblackpy/series/tree_series.pyx":466
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint32':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":485
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint64':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint64, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 485, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":487
 *         elif self.dtype == 'uint64':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                                    name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":489
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                                    name=self.name,             # <<<<<<<<<<<<<<
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 489, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 489, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":490
 *                 self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 490, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 489, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":491
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                    arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 491, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 489, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":492
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 492, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 489, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":488
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 488, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 488, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":487
 *         elif self.dtype == 'uint64':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                                    name=self.name,
 */
      goto __pyx_L7;
    }

    /* "redblackpy/series/tree_series.pyx":495
 * 
 *             else:
 *                 new_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":496
 *             else:
 *                 new_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                             name=self.name,             # <<<<<<<<<<<<<<
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 496, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 496, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":497
 *                 new_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 497, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":498
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":499
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 499, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 496, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":495
 * 
 *             else:
 *                 new_series = __TreeSeries_uint64_t.__new__( __TreeSeries_uint64_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 495, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":500
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 500, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 500, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":501
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 501, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 501, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":502
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'uint96':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 502, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L7:;

    /* "redblackpy/series/tree_series.pyx":485
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint64':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":504
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint96':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint96, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 504, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":506
 *         elif self.dtype == 'uint96':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                                    name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":508
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                                    name=self.name,             # <<<<<<<<<<<<<<
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 508, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 508, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":509
 *                 self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 509, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 508, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":510
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                    arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 510, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 508, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":511
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 511, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 508, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":507
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 507, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 507, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":506
 *         elif self.dtype == 'uint96':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                                    name=self.name,
 */
      goto __pyx_L8;
    }

    /* "redblackpy/series/tree_series.pyx":514
 * 
 *             else:
 *                 new_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":515
 *             else:
 *                 new_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                             name=self.name,             # <<<<<<<<<<<<<<
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 515, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 515, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":516
 *                 new_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 516, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 515, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":517
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 517, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 515, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":518
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 518, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 515, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":514
 * 
 *             else:
 *                 new_series = __TreeSeries_uint96_t.__new__( __TreeSeries_uint96_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 514, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":519
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 519, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 519, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 519, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 519, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 519, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":520
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 520, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 520, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 520, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":521
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'uint128':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 521, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L8:;

    /* "redblackpy/series/tree_series.pyx":504
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint96':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":523
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint128':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_uint128, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 523, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":525
 *         elif self.dtype == 'uint128':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                                     name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":527
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                                     name=self.name,             # <<<<<<<<<<<<<<
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 527, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 527, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":528
 *                 self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 528, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 527, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":529
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                     arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 529, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 527, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":530
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 530, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 527, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":526
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 526, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 526, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":525
 *         elif self.dtype == 'uint128':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                                     name=self.name,
 */
      goto __pyx_L9;
    }

    /* "redblackpy/series/tree_series.pyx":533
 * 
 *             else:
 *                 new_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":534
 *             else:
 *                 new_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                              name=self.name,             # <<<<<<<<<<<<<<
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 534, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":535
 *                 new_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 535, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":536
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 536, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":537
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 537, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 534, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":533
 * 
 *             else:
 *                 new_series = __TreeSeries_uint128_t.__new__( __TreeSeries_uint128_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 533, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":538
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 538, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_5, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 538, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_3);
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); __pyx_t_5 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_3, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 538, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":539
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 539, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 539, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 539, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":540
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'int8':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 540, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L9:;

    /* "redblackpy/series/tree_series.pyx":523
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'uint128':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":542
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int8':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int8, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 542, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":544
 *         elif self.dtype == 'int8':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                                  name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":546
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                                  name=self.name,             # <<<<<<<<<<<<<<
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 546, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 546, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":547
 *                 self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                  extrapolate=self.extrapolation,
 *                                                                  arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 547, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 546, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":548
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                  arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 548, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 546, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":549
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,
 *                                                                  arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 546, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":545
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 545, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 545, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":544
 *         elif self.dtype == 'int8':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                                  name=self.name,
 */
      goto __pyx_L10;
    }

    /* "redblackpy/series/tree_series.pyx":552
 * 
 *             else:
 *                 new_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":553
 *             else:
 *                 new_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                           name=self.name,             # <<<<<<<<<<<<<<
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 553, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 553, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":554
 *                 new_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 553, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":555
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                           arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 555, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 553, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":556
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 556, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 553, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":552
 * 
 *             else:
 *                 new_series = __TreeSeries_int8_t.__new__( __TreeSeries_int8_t,             # <<<<<<<<<<<<<<
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 552, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":557
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 557, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (!__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
          PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
          __Pyx_GOTREF(__pyx_t_1);
        } else
        #endif
        {
          __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_5, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 557, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":558
 *                                                           arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 558, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_5) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 558, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 558, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":559
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 * 
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 559, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L10:;

    /* "redblackpy/series/tree_series.pyx":542
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int8':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":562
 * 
 * 
 *         elif self.dtype == 'int16':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int16, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 562, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":564
 *         elif self.dtype == 'int16':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_int16_t,
 *                                                                    name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":565
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), __pyx_n_s_new); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t));
      __Pyx_GIVEREF(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t));

      /* "redblackpy/series/tree_series.pyx":566
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_int16_t,
 *                                                                    name=self.name,             # <<<<<<<<<<<<<<
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 566, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 566, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":567
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_int16_t,
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 567, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 566, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":568
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                    arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 568, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 566, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":569
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 569, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 566, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":565
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 565, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 565, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":564
 *         elif self.dtype == 'int16':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_uint16_t.__new__( __TreeSeries_int16_t,
 *                                                                    name=self.name,
 */
      goto __pyx_L11;
    }

    /* "redblackpy/series/tree_series.pyx":572
 * 
 *             else:
 *                 new_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":573
 *             else:
 *                 new_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                            name=self.name,             # <<<<<<<<<<<<<<
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 573, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 573, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":574
 *                 new_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 574, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 573, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":575
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 575, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 573, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":576
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 576, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 573, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":572
 * 
 *             else:
 *                 new_series = __TreeSeries_int16_t.__new__( __TreeSeries_int16_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 572, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":577
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 577, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 577, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 577, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 577, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 577, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":578
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 578, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 578, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 578, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":579
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'int32':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 579, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L11:;

    /* "redblackpy/series/tree_series.pyx":562
 * 
 * 
 *         elif self.dtype == 'int16':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":581
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int32':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int32, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 581, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":583
 *         elif self.dtype == 'int32':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                                   name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":585
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                                   name=self.name,             # <<<<<<<<<<<<<<
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 585, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 585, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":586
 *                 self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 586, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 585, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":587
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                   arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 587, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 585, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":588
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 588, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 585, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":584
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 584, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 584, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":583
 *         elif self.dtype == 'int32':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                                   name=self.name,
 */
      goto __pyx_L12;
    }

    /* "redblackpy/series/tree_series.pyx":591
 * 
 *             else:
 *                 new_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":592
 *             else:
 *                 new_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                            name=self.name,             # <<<<<<<<<<<<<<
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 592, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 592, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":593
 *                 new_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 593, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 592, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":594
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 594, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 592, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":595
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 595, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 592, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":591
 * 
 *             else:
 *                 new_series = __TreeSeries_int32_t.__new__( __TreeSeries_int32_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 591, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":596
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 596, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 596, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 596, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 596, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 596, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":597
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 597, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 597, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 597, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":598
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'int64':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 598, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L12:;

    /* "redblackpy/series/tree_series.pyx":581
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int32':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":600
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int64':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int64, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 600, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":602
 *         elif self.dtype == 'int64':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                                   name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":604
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                                   name=self.name,             # <<<<<<<<<<<<<<
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 604, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 604, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":605
 *                 self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 605, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":606
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                   arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 606, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":607
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 604, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":603
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 603, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":602
 *         elif self.dtype == 'int64':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                                   name=self.name,
 */
      goto __pyx_L13;
    }

    /* "redblackpy/series/tree_series.pyx":610
 * 
 *             else:
 *                 new_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":611
 *             else:
 *                 new_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                            name=self.name,             # <<<<<<<<<<<<<<
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 611, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 611, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":612
 *                 new_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 612, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":613
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 613, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":614
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 614, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 611, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":610
 * 
 *             else:
 *                 new_series = __TreeSeries_int64_t.__new__( __TreeSeries_int64_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 610, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":615
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 615, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 615, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 615, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 615, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 615, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 615, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":616
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 616, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 616, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 616, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":617
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'int96':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 617, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L13:;

    /* "redblackpy/series/tree_series.pyx":600
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int64':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":619
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int96':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int96, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 619, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":621
 *         elif self.dtype == 'int96':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                                   name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":623
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                                   name=self.name,             # <<<<<<<<<<<<<<
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 623, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 623, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":624
 *                 self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 624, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 623, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":625
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                   arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 625, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 623, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":626
 *                                                                   interpolate=self.interpolation,
 *                                                                   extrapolate=self.extrapolation,
 *                                                                   arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 626, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 623, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":622
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                                   name=self.name,
 *                                                                   interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 622, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 622, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":621
 *         elif self.dtype == 'int96':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                                   name=self.name,
 */
      goto __pyx_L14;
    }

    /* "redblackpy/series/tree_series.pyx":629
 * 
 *             else:
 *                 new_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":630
 *             else:
 *                 new_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                            name=self.name,             # <<<<<<<<<<<<<<
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 630, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 630, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":631
 *                 new_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 631, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 630, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":632
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 632, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 630, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":633
 *                                                            interpolate=self.interpolation,
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 633, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 630, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":629
 * 
 *             else:
 *                 new_series = __TreeSeries_int96_t.__new__( __TreeSeries_int96_t,             # <<<<<<<<<<<<<<
 *                                                            name=self.name,
 *                                                            interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 629, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":634
 *                                                            extrapolate=self.extrapolation,
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 634, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 634, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 634, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 634, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 634, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":635
 *                                                            arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 635, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 635, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 635, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":636
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'int128':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 636, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L14:;

    /* "redblackpy/series/tree_series.pyx":619
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int96':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":638
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int128':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_int128, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 638, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":640
 *         elif self.dtype == 'int128':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                                    name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":642
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                                    name=self.name,             # <<<<<<<<<<<<<<
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 642, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":643
 *                 self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 643, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":644
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                    arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 644, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":645
 *                                                                    interpolate=self.interpolation,
 *                                                                    extrapolate=self.extrapolation,
 *                                                                    arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 645, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 642, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":641
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                                    name=self.name,
 *                                                                    interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 641, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 641, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":640
 *         elif self.dtype == 'int128':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                                    name=self.name,
 */
      goto __pyx_L15;
    }

    /* "redblackpy/series/tree_series.pyx":648
 * 
 *             else:
 *                 new_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":649
 *             else:
 *                 new_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                             name=self.name,             # <<<<<<<<<<<<<<
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 649, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 649, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":650
 *                 new_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 650, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 649, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":651
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 651, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 649, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":652
 *                                                             interpolate=self.interpolation,
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 652, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 649, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":648
 * 
 *             else:
 *                 new_series = __TreeSeries_int128_t.__new__( __TreeSeries_int128_t,             # <<<<<<<<<<<<<<
 *                                                             name=self.name,
 *                                                             interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 648, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":653
 *                                                             extrapolate=self.extrapolation,
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 653, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 653, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 653, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 653, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 653, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 653, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":654
 *                                                             arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 654, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 654, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 654, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":655
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'float32':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 655, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L15:;

    /* "redblackpy/series/tree_series.pyx":638
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'int128':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":657
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float32':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float32, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 657, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":659
 *         elif self.dtype == 'float32':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                                     name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":661
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                                     name=self.name,             # <<<<<<<<<<<<<<
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 661, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 661, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":662
 *                 self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 662, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 661, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":663
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                     arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 663, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 661, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":664
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 664, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 661, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":660
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 660, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 660, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":659
 *         elif self.dtype == 'float32':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                                     name=self.name,
 */
      goto __pyx_L16;
    }

    /* "redblackpy/series/tree_series.pyx":667
 * 
 *             else:
 *                 new_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":668
 *             else:
 *                 new_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                              name=self.name,             # <<<<<<<<<<<<<<
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 668, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 668, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":669
 *                 new_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":670
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":671
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 671, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 668, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":667
 * 
 *             else:
 *                 new_series = __TreeSeries_float32_t.__new__( __TreeSeries_float32_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 667, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":672
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 672, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 672, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 672, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 672, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":673
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 673, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 673, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":674
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'float64':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 674, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L16:;

    /* "redblackpy/series/tree_series.pyx":657
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float32':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":676
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float64':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float64, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 676, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":678
 *         elif self.dtype == 'float64':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                                     name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":680
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                                     name=self.name,             # <<<<<<<<<<<<<<
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 680, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 680, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":681
 *                 self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 681, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 680, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":682
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                     arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 682, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 680, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":683
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 683, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 680, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":679
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 679, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 679, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":678
 *         elif self.dtype == 'float64':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                                     name=self.name,
 */
      goto __pyx_L17;
    }

    /* "redblackpy/series/tree_series.pyx":686
 * 
 *             else:
 *                 new_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":687
 *             else:
 *                 new_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                              name=self.name,             # <<<<<<<<<<<<<<
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 687, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":688
 *                 new_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 688, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":689
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 689, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":690
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 690, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 687, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":686
 * 
 *             else:
 *                 new_series = __TreeSeries_float64_t.__new__( __TreeSeries_float64_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 686, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":691
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 691, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 691, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 691, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 691, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 691, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 691, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":692
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 692, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 692, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":693
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'float80':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 693, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L17:;

    /* "redblackpy/series/tree_series.pyx":676
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float64':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":695
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float80':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float80, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 695, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":697
 *         elif self.dtype == 'float80':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                                     name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":699
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                                     name=self.name,             # <<<<<<<<<<<<<<
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 699, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 699, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":700
 *                 self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 700, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 699, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":701
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                     arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 701, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 699, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":702
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 702, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 699, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":698
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 698, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 698, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":697
 *         elif self.dtype == 'float80':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                                     name=self.name,
 */
      goto __pyx_L18;
    }

    /* "redblackpy/series/tree_series.pyx":705
 * 
 *             else:
 *                 new_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":706
 *             else:
 *                 new_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                              name=self.name,             # <<<<<<<<<<<<<<
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 706, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":707
 *                 new_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 707, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":708
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 708, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":709
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 709, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 706, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":705
 * 
 *             else:
 *                 new_series = __TreeSeries_float80_t.__new__( __TreeSeries_float80_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 705, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":710
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 710, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 710, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 710, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 710, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 710, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 710, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":711
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 711, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 711, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 711, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":712
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'float96':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 712, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L18:;

    /* "redblackpy/series/tree_series.pyx":695
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float80':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":714
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float96':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float96, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 714, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":716
 *         elif self.dtype == 'float96':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                                     name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":718
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                                     name=self.name,             # <<<<<<<<<<<<<<
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 718, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":719
 *                 self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 719, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":720
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                     arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 720, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":721
 *                                                                     interpolate=self.interpolation,
 *                                                                     extrapolate=self.extrapolation,
 *                                                                     arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 721, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 718, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":717
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                                     name=self.name,
 *                                                                     interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 717, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 717, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":716
 *         elif self.dtype == 'float96':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                                     name=self.name,
 */
      goto __pyx_L19;
    }

    /* "redblackpy/series/tree_series.pyx":724
 * 
 *             else:
 *                 new_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":725
 *             else:
 *                 new_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                              name=self.name,             # <<<<<<<<<<<<<<
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 725, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 725, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":726
 *                 new_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 726, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 725, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":727
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 727, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 725, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":728
 *                                                              interpolate=self.interpolation,
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 728, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 725, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":724
 * 
 *             else:
 *                 new_series = __TreeSeries_float96_t.__new__( __TreeSeries_float96_t,             # <<<<<<<<<<<<<<
 *                                                              name=self.name,
 *                                                              interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 724, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":729
 *                                                              extrapolate=self.extrapolation,
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 729, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_2, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 729, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_1, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 729, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":730
 *                                                              arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 730, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 730, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 730, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":731
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'float128':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 731, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L19:;

    /* "redblackpy/series/tree_series.pyx":714
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float96':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":733
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float128':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_float128, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 733, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":735
 *         elif self.dtype == 'float128':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                                      name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":737
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                                      name=self.name,             # <<<<<<<<<<<<<<
 *                                                                      interpolate=self.interpolation,
 *                                                                      extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 737, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 737, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":738
 *                 self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                                      name=self.name,
 *                                                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                      extrapolate=self.extrapolation,
 *                                                                      arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 738, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":739
 *                                                                      name=self.name,
 *                                                                      interpolate=self.interpolation,
 *                                                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                      arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 739, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":740
 *                                                                      interpolate=self.interpolation,
 *                                                                      extrapolate=self.extrapolation,
 *                                                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 740, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 737, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":736
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                                      name=self.name,
 *                                                                      interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 736, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 736, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":735
 *         elif self.dtype == 'float128':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                                      name=self.name,
 */
      goto __pyx_L20;
    }

    /* "redblackpy/series/tree_series.pyx":743
 * 
 *             else:
 *                 new_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                               name=self.name,
 *                                                               interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":744
 *             else:
 *                 new_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                               name=self.name,             # <<<<<<<<<<<<<<
 *                                                               interpolate=self.interpolation,
 *                                                               extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 744, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 744, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":745
 *                 new_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,
 *                                                               name=self.name,
 *                                                               interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                               extrapolate=self.extrapolation,
 *                                                               arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 745, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 744, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":746
 *                                                               name=self.name,
 *                                                               interpolate=self.interpolation,
 *                                                               extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                               arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 746, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 744, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":747
 *                                                               interpolate=self.interpolation,
 *                                                               extrapolate=self.extrapolation,
 *                                                               arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 744, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":743
 * 
 *             else:
 *                 new_series = __TreeSeries_float128_t.__new__( __TreeSeries_float128_t,             # <<<<<<<<<<<<<<
 *                                                               name=self.name,
 *                                                               interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 743, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":748
 *                                                               extrapolate=self.extrapolation,
 *                                                               arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 748, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_1)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_1);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (!__pyx_t_1) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, ((PyObject *)__pyx_v_self->dtype_series)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 748, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
      } else {
        #if CYTHON_FAST_PYCALL
        if (PyFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 748, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        #if CYTHON_FAST_PYCCALL
        if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
          PyObject *__pyx_temp[2] = {__pyx_t_1, ((PyObject *)__pyx_v_self->dtype_series)};
          __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 748, __pyx_L1_error)
          __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_GOTREF(__pyx_t_5);
        } else
        #endif
        {
          __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 748, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1); __pyx_t_1 = NULL;
          __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
          __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
          PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_self->dtype_series));
          __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 748, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        }
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":749
 *                                                               arithmetic=self.arithmetic )
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 749, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 749, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 749, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":750
 *                 new_series.copy_data(self.dtype_series)
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'object':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 750, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L20:;

    /* "redblackpy/series/tree_series.pyx":733
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'float128':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":752
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'object':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_object, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 752, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "redblackpy/series/tree_series.pyx":754
 *         elif self.dtype == 'object':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":756
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,             # <<<<<<<<<<<<<<
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,
 */
      __pyx_t_5 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 756, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 756, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":757
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                  extrapolate=self.extrapolation,
 *                                                                  arithmetic=self.arithmetic )
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 757, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_interpolate, __pyx_t_3) < 0) __PYX_ERR(1, 756, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":758
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                  arithmetic=self.arithmetic )
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 758, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_extrapolate, __pyx_t_3) < 0) __PYX_ERR(1, 756, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":759
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,
 *                                                                  arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 759, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_arithmetic, __pyx_t_3) < 0) __PYX_ERR(1, 756, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":755
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,
 */
      __pyx_t_3 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_5)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 755, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_3), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 755, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_3);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_3);
      __pyx_t_3 = 0;

      /* "redblackpy/series/tree_series.pyx":754
 *         elif self.dtype == 'object':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,
 */
      goto __pyx_L21;
    }

    /* "redblackpy/series/tree_series.pyx":761
 *                                                                  arithmetic=self.arithmetic )
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":762
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                           name=self.name,             # <<<<<<<<<<<<<<
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 762, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 762, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":763
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 763, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_5) < 0) __PYX_ERR(1, 762, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":764
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                           arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 764, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_5) < 0) __PYX_ERR(1, 762, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":765
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *                 new_series.copy_data(self.dtype_series, to_type="object")
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 765, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_5) < 0) __PYX_ERR(1, 762, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":761
 *                                                                  arithmetic=self.arithmetic )
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 */
      __pyx_t_5 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_3)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 761, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_5);
      __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":767
 *                                                           arithmetic=self.arithmetic )
 * 
 *                 new_series.copy_data(self.dtype_series, to_type="object")             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self->dtype_series));
      __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_to_type, __pyx_n_s_object) < 0) __PYX_ERR(1, 767, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 767, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":768
 * 
 *                 new_series.copy_data(self.dtype_series, to_type="object")
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 768, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
        }
      }
      if (__pyx_t_3) {
        __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 768, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 768, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":769
 *                 new_series.copy_data(self.dtype_series, to_type="object")
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         elif self.dtype == 'str':
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 769, __pyx_L1_error)
      __pyx_t_1 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_1);
      __pyx_t_1 = 0;
    }
    __pyx_L21:;

    /* "redblackpy/series/tree_series.pyx":752
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'object':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":771
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'str':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
  __pyx_t_6 = (__Pyx_PyString_Equals(__pyx_v_self->dtype, __pyx_n_s_str, Py_EQ)); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 771, __pyx_L1_error)
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (likely(__pyx_t_7)) {

    /* "redblackpy/series/tree_series.pyx":773
 *         elif self.dtype == 'str':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,
 */
    __pyx_t_7 = (((PyObject *)__pyx_v_self->dtype_series) == Py_None);
    __pyx_t_6 = (__pyx_t_7 != 0);
    if (__pyx_t_6) {

      /* "redblackpy/series/tree_series.pyx":775
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,             # <<<<<<<<<<<<<<
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,
 */
      __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 775, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 775, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":776
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                                  extrapolate=self.extrapolation,
 *                                                                  arithmetic=self.arithmetic )
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 776, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 775, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":777
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                                  arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 777, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 775, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":778
 *                                                                  interpolate=self.interpolation,
 *                                                                  extrapolate=self.extrapolation,
 *                                                                  arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *             else:
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 778, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 775, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":774
 * 
 *             if self.dtype_series is None:
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                                  name=self.name,
 *                                                                  interpolate=self.interpolation,
 */
      __pyx_t_2 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 774, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_t_2), __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)))) __PYX_ERR(1, 774, __pyx_L1_error)
      __Pyx_GIVEREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
      __pyx_t_2 = 0;

      /* "redblackpy/series/tree_series.pyx":773
 *         elif self.dtype == 'str':
 * 
 *             if self.dtype_series is None:             # <<<<<<<<<<<<<<
 *                 self.dtype_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                                  name=self.name,
 */
      goto __pyx_L22;
    }

    /* "redblackpy/series/tree_series.pyx":781
 * 
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 */
    /*else*/ {

      /* "redblackpy/series/tree_series.pyx":782
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                           name=self.name,             # <<<<<<<<<<<<<<
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,
 */
      __pyx_t_2 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 782, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_name, __pyx_v_self->name) < 0) __PYX_ERR(1, 782, __pyx_L1_error)

      /* "redblackpy/series/tree_series.pyx":783
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 783, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_interpolate, __pyx_t_1) < 0) __PYX_ERR(1, 782, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":784
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                                           arithmetic=self.arithmetic )
 * 
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 784, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_extrapolate, __pyx_t_1) < 0) __PYX_ERR(1, 782, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":785
 *                                                           interpolate=self.interpolation,
 *                                                           extrapolate=self.extrapolation,
 *                                                           arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *                 new_series.copy_data(self.dtype_series, to_type="str")
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 785, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_arithmetic, __pyx_t_1) < 0) __PYX_ERR(1, 782, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":781
 * 
 *             else:
 *                 new_series = __TreeSeries_object.__new__( __TreeSeries_object,             # <<<<<<<<<<<<<<
 *                                                           name=self.name,
 *                                                           interpolate=self.interpolation,
 */
      __pyx_t_1 = ((PyObject *)__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(((PyTypeObject *)__pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object), __pyx_empty_tuple, __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 781, __pyx_L1_error)
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_v_new_series = ((PyObject *)__pyx_t_1);
      __pyx_t_1 = 0;

      /* "redblackpy/series/tree_series.pyx":787
 *                                                           arithmetic=self.arithmetic )
 * 
 *                 new_series.copy_data(self.dtype_series, to_type="str")             # <<<<<<<<<<<<<<
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_series, __pyx_n_s_copy_data); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_INCREF(((PyObject *)__pyx_v_self->dtype_series));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_self->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self->dtype_series));
      __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_to_type, __pyx_n_s_str) < 0) __PYX_ERR(1, 787, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 787, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":788
 * 
 *                 new_series.copy_data(self.dtype_series, to_type="str")
 *                 self.dtype_series.clear()             # <<<<<<<<<<<<<<
 *                 self.dtype_series = new_series
 * 
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_clear); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 788, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = NULL;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_2) {
        __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 788, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else {
        __pyx_t_5 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 788, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "redblackpy/series/tree_series.pyx":789
 *                 new_series.copy_data(self.dtype_series, to_type="str")
 *                 self.dtype_series.clear()
 *                 self.dtype_series = new_series             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
      if (!(likely(((__pyx_v_new_series) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_new_series, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 789, __pyx_L1_error)
      __pyx_t_5 = __pyx_v_new_series;
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __Pyx_GOTREF(__pyx_v_self->dtype_series);
      __Pyx_DECREF(((PyObject *)__pyx_v_self->dtype_series));
      __pyx_v_self->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_5);
      __pyx_t_5 = 0;
    }
    __pyx_L22:;

    /* "redblackpy/series/tree_series.pyx":771
 *                 self.dtype_series = new_series
 * 
 *         elif self.dtype == 'str':             # <<<<<<<<<<<<<<
 * 
 *             if self.dtype_series is None:
 */
    goto __pyx_L3;
  }

  /* "redblackpy/series/tree_series.pyx":792
 * 
 *         else:
 *             raise TypeError( "Unsupported data type {:}".format(dtype) )             # <<<<<<<<<<<<<<
 * 
 *         self.dtype = dtype
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_kp_s_Unsupported_data_type, __pyx_n_s_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    if (!__pyx_t_2) {
      __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_dtype); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 792, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_dtype};
        __pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 792, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
        PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_dtype};
        __pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 792, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_5);
      } else
      #endif
      {
        __pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); __pyx_t_2 = NULL;
        __Pyx_INCREF(__pyx_v_dtype);
        __Pyx_GIVEREF(__pyx_v_dtype);
        PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_dtype);
        __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 792, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 792, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 792, __pyx_L1_error)
  }
  __pyx_L3:;

  /* "redblackpy/series/tree_series.pyx":794
 *             raise TypeError( "Unsupported data type {:}".format(dtype) )
 * 
 *         self.dtype = dtype             # <<<<<<<<<<<<<<
 * 
 *     #--------------------------------------------------------------------------------------------
 */
  __Pyx_INCREF(__pyx_v_dtype);
  __Pyx_GIVEREF(__pyx_v_dtype);
  __Pyx_GOTREF(__pyx_v_self->dtype);
  __Pyx_DECREF(__pyx_v_self->dtype);
  __pyx_v_self->dtype = __pyx_v_dtype;

  /* "redblackpy/series/tree_series.pyx":421
 * 
 *     @cython.embedsignature(True)
 *     cpdef void cast_dtype(self, str dtype) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to specific dtype.
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.cast_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_series);
  __Pyx_RefNannyFinishContext();
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_41cast_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_dtype); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_40cast_dtype[] = "Series.cast_dtype(self, str dtype) -> void\n\n        Cast values to specific dtype.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_41cast_dtype = {"cast_dtype", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_41cast_dtype, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_40cast_dtype};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_41cast_dtype(PyObject *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("cast_dtype (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dtype), (&PyString_Type), 1, "dtype", 1))) __PYX_ERR(1, 421, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_40cast_dtype(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject*)__pyx_v_dtype));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_40cast_dtype(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_dtype) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("cast_dtype", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_f_10redblackpy_6series_11tree_series_6Series_cast_dtype(__pyx_v_self, __pyx_v_dtype, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 421, __pyx_L1_error)
  __pyx_t_1 = __Pyx_void_to_None(NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 421, __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("redblackpy.series.tree_series.Series.cast_dtype", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":800
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef to_pandas(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to pandas.Series.
 */

static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_43to_pandas(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static PyObject *__pyx_f_10redblackpy_6series_11tree_series_6Series_to_pandas(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, int __pyx_skip_dispatch) {
  PyObject *__pyx_v_pd = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("to_pandas", 0);
  /* Check if called by wrapper */
  if (unlikely(__pyx_skip_dispatch)) ;
  /* Check if overridden in Python */
  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_to_pandas); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 800, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_43to_pandas)) {
      __Pyx_XDECREF(__pyx_r);
      __Pyx_INCREF(__pyx_t_1);
      __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_4)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_4);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
        }
      }
      if (__pyx_t_4) {
        __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 800, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      } else {
        __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 800, __pyx_L1_error)
      }
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_r = __pyx_t_2;
      __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      goto __pyx_L0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }

  /* "redblackpy/series/tree_series.pyx":804
 *         Convert to pandas.Series.
 *         """
 *         import pandas as pd             # <<<<<<<<<<<<<<
 * 
 *         return pd.Series( data=self.values(), index=self.index() )
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pd = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":806
 *         import pandas as pd
 * 
 *         return pd.Series( data=self.values(), index=self.index() )             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd, __pyx_n_s_Series); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->values(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_data, __pyx_t_3) < 0) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->index(__pyx_v_self, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_index, __pyx_t_3) < 0) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":800
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef to_pandas(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to pandas.Series.
 */

  /* 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("redblackpy.series.tree_series.Series.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pd);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_43to_pandas(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_42to_pandas[] = "Series.to_pandas(self)\n\n        Convert to pandas.Series.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_43to_pandas = {"to_pandas", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_43to_pandas, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_42to_pandas};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_43to_pandas(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("to_pandas (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_42to_pandas(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_42to_pandas(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("to_pandas", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_10redblackpy_6series_11tree_series_6Series_to_pandas(__pyx_v_self, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 800, __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("redblackpy.series.tree_series.Series.to_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":810
 * 
 *     @staticmethod
 *     def from_pandas( pd_series, str interpolate='floor', extrapolate=0,             # <<<<<<<<<<<<<<
 *                      str arithmetic='left' ):
 *         """
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_45from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_44from_pandas[] = "Series.from_pandas(pd_series, str interpolate='floor', extrapolate=0, str arithmetic='left')\n\n        Initialize Series object from pandas.Series.\n        ";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_45from_pandas = {"from_pandas", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_45from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_44from_pandas};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_45from_pandas(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_pd_series = 0;
  PyObject *__pyx_v_interpolate = 0;
  PyObject *__pyx_v_extrapolate = 0;
  PyObject *__pyx_v_arithmetic = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("from_pandas (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pd_series,&__pyx_n_s_interpolate,&__pyx_n_s_extrapolate,&__pyx_n_s_arithmetic,0};
    PyObject* values[4] = {0,0,0,0};
    values[1] = ((PyObject*)__pyx_n_s_floor);
    values[2] = ((PyObject *)__pyx_int_0);
    values[3] = ((PyObject*)__pyx_n_s_left);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pd_series)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_interpolate);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_extrapolate);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_arithmetic);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "from_pandas") < 0)) __PYX_ERR(1, 810, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_pd_series = values[0];
    __pyx_v_interpolate = ((PyObject*)values[1]);
    __pyx_v_extrapolate = values[2];
    __pyx_v_arithmetic = ((PyObject*)values[3]);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("from_pandas", 0, 1, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 810, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_interpolate), (&PyString_Type), 1, "interpolate", 1))) __PYX_ERR(1, 810, __pyx_L1_error)
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_arithmetic), (&PyString_Type), 1, "arithmetic", 1))) __PYX_ERR(1, 811, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_44from_pandas(__pyx_v_pd_series, __pyx_v_interpolate, __pyx_v_extrapolate, __pyx_v_arithmetic);

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_44from_pandas(PyObject *__pyx_v_pd_series, PyObject *__pyx_v_interpolate, PyObject *__pyx_v_extrapolate, PyObject *__pyx_v_arithmetic) {
  CYTHON_UNUSED PyObject *__pyx_v_pd = NULL;
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("from_pandas", 0);

  /* "redblackpy/series/tree_series.pyx":815
 *         Initialize Series object from pandas.Series.
 *         """
 *         import pandas as pd             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( index=pd_series.index,
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_pandas, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 815, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_pd = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":817
 *         import pandas as pd
 * 
 *         cdef Series result = Series( index=pd_series.index,             # <<<<<<<<<<<<<<
 *                                      values=pd_series.data,
 *                                      dtype=str(pd_series.dtype),
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd_series, __pyx_n_s_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":818
 * 
 *         cdef Series result = Series( index=pd_series.index,
 *                                      values=pd_series.data,             # <<<<<<<<<<<<<<
 *                                      dtype=str(pd_series.dtype),
 *                                      interpolate=interpolate,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd_series, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 818, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_values, __pyx_t_2) < 0) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":819
 *         cdef Series result = Series( index=pd_series.index,
 *                                      values=pd_series.data,
 *                                      dtype=str(pd_series.dtype),             # <<<<<<<<<<<<<<
 *                                      interpolate=interpolate,
 *                                      extrapolate=extrapolate,
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_pd_series, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 819, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "redblackpy/series/tree_series.pyx":820
 *                                      values=pd_series.data,
 *                                      dtype=str(pd_series.dtype),
 *                                      interpolate=interpolate,             # <<<<<<<<<<<<<<
 *                                      extrapolate=extrapolate,
 *                                      arithmetic=arithmetic )
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_v_interpolate) < 0) __PYX_ERR(1, 817, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":821
 *                                      dtype=str(pd_series.dtype),
 *                                      interpolate=interpolate,
 *                                      extrapolate=extrapolate,             # <<<<<<<<<<<<<<
 *                                      arithmetic=arithmetic )
 *         return result
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_v_extrapolate) < 0) __PYX_ERR(1, 817, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":822
 *                                      interpolate=interpolate,
 *                                      extrapolate=extrapolate,
 *                                      arithmetic=arithmetic )             # <<<<<<<<<<<<<<
 *         return result
 *     #--------------------------------------------------------------------------------------------
 */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_v_arithmetic) < 0) __PYX_ERR(1, 817, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":817
 *         import pandas as pd
 * 
 *         cdef Series result = Series( index=pd_series.index,             # <<<<<<<<<<<<<<
 *                                      values=pd_series.data,
 *                                      dtype=str(pd_series.dtype),
 */
  __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 817, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "redblackpy/series/tree_series.pyx":823
 *                                      extrapolate=extrapolate,
 *                                      arithmetic=arithmetic )
 *         return result             # <<<<<<<<<<<<<<
 *     #--------------------------------------------------------------------------------------------
 *     # Special methods
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":810
 * 
 *     @staticmethod
 *     def from_pandas( pd_series, str interpolate='floor', extrapolate=0,             # <<<<<<<<<<<<<<
 *                      str arithmetic='left' ):
 *         """
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.from_pandas", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_pd);
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":827
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __del__(self):             # <<<<<<<<<<<<<<
 * 
 *         self.dtype_series.__del__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_47__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_46__del__[] = "Series.__del__(self)";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_47__del__ = {"__del__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_47__del__, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_46__del__};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_47__del__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_46__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_46__del__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__del__", 0);

  /* "redblackpy/series/tree_series.pyx":829
 *     def __del__(self):
 * 
 *         self.dtype_series.__del__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_del); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 829, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":827
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __del__(self):             # <<<<<<<<<<<<<<
 * 
 *         self.dtype_series.__del__()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__del__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":832
 * 
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__len__()
 */

/* Python wrapper */
static Py_ssize_t __pyx_pw_10redblackpy_6series_11tree_series_6Series_49__len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pw_10redblackpy_6series_11tree_series_6Series_49__len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_48__len__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Py_ssize_t __pyx_pf_10redblackpy_6series_11tree_series_6Series_48__len__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__len__", 0);

  /* "redblackpy/series/tree_series.pyx":834
 *     def __len__(self):
 * 
 *         return self.dtype_series.__len__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 834, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 834, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 834, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":832
 * 
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__len__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":837
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_51__str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_51__str__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_50__str__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_50__str__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__str__", 0);

  /* "redblackpy/series/tree_series.pyx":839
 *     def __str__(self):
 * 
 *         return self.dtype_series.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 839, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 839, __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;

  /* "redblackpy/series/tree_series.pyx":837
 * 
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":842
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__str__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_53__repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_53__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_52__repr__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_52__repr__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "redblackpy/series/tree_series.pyx":844
 *     def __repr__(self):
 * 
 *         return self.dtype_series.__str__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_str_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 844, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 844, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 844, __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;

  /* "redblackpy/series/tree_series.pyx":842
 * 
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__str__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":847
 * 
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__contains__(key)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_55__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_55__contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__contains__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_54__contains__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_54__contains__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key) {
  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;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__contains__", 0);

  /* "redblackpy/series/tree_series.pyx":849
 *     def __contains__(self, key):
 * 
 *         return self.dtype_series.__contains__(key)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_contains); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 849, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 849, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_key};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 849, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_1);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_key);
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 849, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 849, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_5;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":847
 * 
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__contains__(key)
 */

  /* 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("redblackpy.series.tree_series.Series.__contains__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":852
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__iter__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_57__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_57__iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_56__iter__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_56__iter__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "redblackpy/series/tree_series.pyx":854
 *     def __iter__(self):
 * 
 *         return self.dtype_series.__iter__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_iter); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 854, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 854, __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;

  /* "redblackpy/series/tree_series.pyx":852
 * 
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 * 
 *         return self.dtype_series.__iter__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__iter__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":857
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(key, slice):
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_59__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_59__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_58__getitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_58__getitem__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "redblackpy/series/tree_series.pyx":859
 *     def __getitem__(self, key):
 * 
 *         if not isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.dtype_series.__getitem__(key)
 * 
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
  if (__pyx_t_2) {

    /* "redblackpy/series/tree_series.pyx":860
 * 
 *         if not isinstance(key, slice):
 *             return self.dtype_series.__getitem__(key)             # <<<<<<<<<<<<<<
 * 
 *         result = Series( dtype=self.dtype,
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_getitem); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 860, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    if (!__pyx_t_5) {
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_key); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
    } else {
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
        PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
      } else
      #endif
      {
        __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
        __Pyx_INCREF(__pyx_v_key);
        __Pyx_GIVEREF(__pyx_v_key);
        PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_key);
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 860, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "redblackpy/series/tree_series.pyx":859
 *     def __getitem__(self, key):
 * 
 *         if not isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             return self.dtype_series.__getitem__(key)
 * 
 */
  }

  /* "redblackpy/series/tree_series.pyx":862
 *             return self.dtype_series.__getitem__(key)
 * 
 *         result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                          interpolate=self.interpolation,
 *                          extrapolate=self.extrapolation,
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_v_self->dtype) < 0) __PYX_ERR(1, 862, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":863
 * 
 *         result = Series( dtype=self.dtype,
 *                          interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                          extrapolate=self.extrapolation,
 *                          arithmetic=self.arithmetic )
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_interpolation); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 863, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_interpolate, __pyx_t_4) < 0) __PYX_ERR(1, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/series/tree_series.pyx":864
 *         result = Series( dtype=self.dtype,
 *                          interpolate=self.interpolation,
 *                          extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                          arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 864, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_extrapolate, __pyx_t_4) < 0) __PYX_ERR(1, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/series/tree_series.pyx":865
 *                          interpolate=self.interpolation,
 *                          extrapolate=self.extrapolation,
 *                          arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         (<Series>result).dtype_series = self.dtype_series.__getitem__(key)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 865, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_arithmetic, __pyx_t_4) < 0) __PYX_ERR(1, 862, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "redblackpy/series/tree_series.pyx":862
 *             return self.dtype_series.__getitem__(key)
 * 
 *         result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                          interpolate=self.interpolation,
 *                          extrapolate=self.extrapolation,
 */
  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 862, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "redblackpy/series/tree_series.pyx":867
 *                          arithmetic=self.arithmetic )
 * 
 *         (<Series>result).dtype_series = self.dtype_series.__getitem__(key)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_getitem); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 867, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  if (!__pyx_t_6) {
    __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_key); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 867, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_key};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_key};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
      __Pyx_INCREF(__pyx_v_key);
      __Pyx_GIVEREF(__pyx_v_key);
      PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_key);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 867, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 867, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_4);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_4);
  __pyx_t_4 = 0;

  /* "redblackpy/series/tree_series.pyx":869
 *         (<Series>result).dtype_series = self.dtype_series.__getitem__(key)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":857
 * 
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 * 
 *         if not isinstance(key, slice):
 */

  /* 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("redblackpy.series.tree_series.Series.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":872
 * 
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 * 
 *         self.dtype_series.__setitem__(key, value)
 */

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_61__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_61__setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_60__setitem__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_60__setitem__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__setitem__", 0);

  /* "redblackpy/series/tree_series.pyx":874
 *     def __setitem__(self, key, value):
 * 
 *         self.dtype_series.__setitem__(key, value)             # <<<<<<<<<<<<<<
 * 
 *     #-------------------------------------------------------------------------------------------------
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_setitem); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 874, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_key, __pyx_v_value};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 2+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 874, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_v_key);
    __Pyx_GIVEREF(__pyx_v_key);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_v_key);
    __Pyx_INCREF(__pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_v_value);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 874, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":872
 * 
 * 
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<<
 * 
 *         self.dtype_series.__setitem__(key, value)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":879
 *     # Emulating numeric types
 *     #-------------------------------------------------------------------------------------------------
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_63__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_63__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_62__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_other));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_62__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "redblackpy/series/tree_series.pyx":881
 *     def __add__(self, other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":882
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":883
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":884
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.add( (<Series?>other).dtype_series )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":881
 *     def __add__(self, other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":886
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.add( (<Series?>other).dtype_series )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_add); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(__pyx_v_other, __pyx_ptype_10redblackpy_6series_11tree_series_Series)))) __PYX_ERR(1, 886, __pyx_L1_error)
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other)->dtype_series)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other)->dtype_series)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other)->dtype_series)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other)->dtype_series));
      __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other)->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other)->dtype_series));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 886, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 886, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":888
 *         result.dtype_series = (<Series>self).dtype_series.add( (<Series?>other).dtype_series )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":879
 *     # Emulating numeric types
 *     #-------------------------------------------------------------------------------------------------
 *     def __add__(self, other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":891
 * 
 * 
 *     def __sub__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_65__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_65__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series, 1, "other", 0))) __PYX_ERR(1, 891, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_64__sub__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_64__sub__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "redblackpy/series/tree_series.pyx":893
 *     def __sub__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":894
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 894, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":895
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 895, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":896
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.sub( (<Series?>other).dtype_series )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 896, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":893
 *     def __sub__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":898
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.sub( (<Series?>other).dtype_series )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_sub); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 898, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series)))) __PYX_ERR(1, 898, __pyx_L1_error)
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_other->dtype_series)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 898, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_other->dtype_series));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_other->dtype_series));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 898, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 898, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":900
 *         result.dtype_series = (<Series>self).dtype_series.sub( (<Series?>other).dtype_series )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":891
 * 
 * 
 *     def __sub__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":903
 * 
 * 
 *     def __mul__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_67__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_67__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series, 1, "other", 0))) __PYX_ERR(1, 903, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_66__mul__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_66__mul__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__mul__", 0);

  /* "redblackpy/series/tree_series.pyx":905
 *     def __mul__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":906
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 906, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":907
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":908
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.mul( (<Series?>other).dtype_series )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":905
 *     def __mul__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 905, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":910
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.mul( (<Series?>other).dtype_series )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_mul); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series)))) __PYX_ERR(1, 910, __pyx_L1_error)
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_other->dtype_series)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 910, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 910, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_other->dtype_series));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_other->dtype_series));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 910, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 910, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":912
 *         result.dtype_series = (<Series>self).dtype_series.mul( (<Series?>other).dtype_series )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":903
 * 
 * 
 *     def __mul__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":915
 * 
 * 
 *     def __div__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_69__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_69__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series, 1, "other", 0))) __PYX_ERR(1, 915, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_68__div__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/

#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_68__div__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__div__", 0);

  /* "redblackpy/series/tree_series.pyx":917
 *     def __div__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":918
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 918, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":919
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":920
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.div( (<Series?>other).dtype_series )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":917
 *     def __div__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":922
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.div( (<Series?>other).dtype_series )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series)))) __PYX_ERR(1, 922, __pyx_L1_error)
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_other->dtype_series)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_other->dtype_series));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_other->dtype_series));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 922, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 922, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":924
 *         result.dtype_series = (<Series>self).dtype_series.div( (<Series?>other).dtype_series )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":915
 * 
 * 
 *     def __div__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/

/* "redblackpy/series/tree_series.pyx":927
 * 
 * 
 *     def __truediv__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_71__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_71__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series, 1, "other", 0))) __PYX_ERR(1, 927, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_70__truediv__(((PyObject *)__pyx_v_self), ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_other));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_70__truediv__(PyObject *__pyx_v_self, struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_other) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__truediv__", 0);

  /* "redblackpy/series/tree_series.pyx":929
 *     def __truediv__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":930
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":931
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 931, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":932
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.div( (<Series?>other).dtype_series )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 932, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":929
 *     def __truediv__(self, Series other):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":934
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.div( (<Series?>other).dtype_series )             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_div); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(__Pyx_TypeTest(((PyObject *)__pyx_v_other), __pyx_ptype_10redblackpy_6series_11tree_series_Series)))) __PYX_ERR(1, 934, __pyx_L1_error)
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_other->dtype_series)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 934, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 934, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, ((PyObject *)__pyx_v_other->dtype_series)};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 934, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 934, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(((PyObject *)__pyx_v_other->dtype_series));
      __Pyx_GIVEREF(((PyObject *)__pyx_v_other->dtype_series));
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, ((PyObject *)__pyx_v_other->dtype_series));
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 934, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 934, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":936
 *         result.dtype_series = (<Series>self).dtype_series.div( (<Series?>other).dtype_series )
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":927
 * 
 * 
 *     def __truediv__(self, Series other):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":939
 * 
 * 
 *     def __lshift__(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_73__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_73__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__lshift__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_72__lshift__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_72__lshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__lshift__", 0);

  /* "redblackpy/series/tree_series.pyx":941
 *     def __lshift__(self, shift_param):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":942
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 942, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":943
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 943, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":944
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.lshift(shift_param)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":941
 *     def __lshift__(self, shift_param):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 941, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":946
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.lshift(shift_param)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_lshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 946, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_shift_param};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_shift_param};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_shift_param);
      __Pyx_GIVEREF(__pyx_v_shift_param);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_shift_param);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 946, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 946, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":948
 *         result.dtype_series = (<Series>self).dtype_series.lshift(shift_param)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":939
 * 
 * 
 *     def __lshift__(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__lshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":951
 * 
 * 
 *     def __rshift__(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_75__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_75__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__rshift__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_74__rshift__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_shift_param));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_74__rshift__(PyObject *__pyx_v_self, PyObject *__pyx_v_shift_param) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__rshift__", 0);

  /* "redblackpy/series/tree_series.pyx":953
 *     def __rshift__(self, shift_param):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_dtype); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":954
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,             # <<<<<<<<<<<<<<
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_interpolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 954, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_interpolate, __pyx_t_2) < 0) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":955
 *         cdef Series result = Series( dtype=self.dtype,
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,             # <<<<<<<<<<<<<<
 *                                      arithmetic=self.arithmetic )
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_extrapolation); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 955, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_extrapolate, __pyx_t_2) < 0) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":956
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 *                                      arithmetic=self.arithmetic )             # <<<<<<<<<<<<<<
 * 
 *         result.dtype_series = (<Series>self).dtype_series.rshift(shift_param)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":953
 *     def __rshift__(self, shift_param):
 * 
 *         cdef Series result = Series( dtype=self.dtype,             # <<<<<<<<<<<<<<
 *                                      interpolate=self.interpolation,
 *                                      extrapolate=self.extrapolation,
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_result = ((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":958
 *                                      arithmetic=self.arithmetic )
 * 
 *         result.dtype_series = (<Series>self).dtype_series.rshift(shift_param)             # <<<<<<<<<<<<<<
 * 
 *         return result
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self)->dtype_series), __pyx_n_s_rshift); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  if (!__pyx_t_3) {
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_shift_param); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
  } else {
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_shift_param};
      __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 958, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_shift_param};
      __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 958, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_2);
    } else
    #endif
    {
      __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
      __Pyx_INCREF(__pyx_v_shift_param);
      __Pyx_GIVEREF(__pyx_v_shift_param);
      PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v_shift_param);
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 958, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries))))) __PYX_ERR(1, 958, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_result->dtype_series);
  __Pyx_DECREF(((PyObject *)__pyx_v_result->dtype_series));
  __pyx_v_result->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":960
 *         result.dtype_series = (<Series>self).dtype_series.rshift(shift_param)
 * 
 *         return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = ((PyObject *)__pyx_v_result);
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":951
 * 
 * 
 *     def __rshift__(self, shift_param):             # <<<<<<<<<<<<<<
 * 
 *         cdef Series result = Series( dtype=self.dtype,
 */

  /* 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("redblackpy.series.tree_series.Series.__rshift__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":966
 *     # Pickle serialization
 *     #--------------------------------------------------------------------------------------------------
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 * 
 *         return Series, (), self.__getstate__()
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_77__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_76__reduce__[] = "Series.__reduce__(self)";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_77__reduce__ = {"__reduce__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_77__reduce__, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_76__reduce__};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_77__reduce__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_76__reduce__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_76__reduce__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("__reduce__", 0);

  /* "redblackpy/series/tree_series.pyx":968
 *     def __reduce__(self):
 * 
 *         return Series, (), self.__getstate__()             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getstate); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  if (__pyx_t_3) {
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 968, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    __pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 968, __pyx_L1_error)
  }
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series));
  __Pyx_GIVEREF(((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series));
  __Pyx_INCREF(__pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_empty_tuple);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_empty_tuple);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":966
 *     # Pickle serialization
 *     #--------------------------------------------------------------------------------------------------
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 * 
 *         return Series, (), self.__getstate__()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__reduce__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":971
 * 
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef dict state = {}
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_79__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_78__getstate__[] = "Series.__getstate__(self)";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_79__getstate__ = {"__getstate__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_79__getstate__, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_78__getstate__};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_79__getstate__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getstate__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_78__getstate__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_78__getstate__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__getstate__", 0);

  /* "redblackpy/series/tree_series.pyx":973
 *     def __getstate__(self):
 * 
 *         cdef dict state = {}             # <<<<<<<<<<<<<<
 * 
 *         state['items']       = self.items()
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_state = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":975
 *         cdef dict state = {}
 * 
 *         state['items']       = self.items()             # <<<<<<<<<<<<<<
 *         state['dtype']       = self.dtype
 *         state['name']        = self.name
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->items(__pyx_v_self, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_state, __pyx_n_s_items, __pyx_t_1) < 0)) __PYX_ERR(1, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":976
 * 
 *         state['items']       = self.items()
 *         state['dtype']       = self.dtype             # <<<<<<<<<<<<<<
 *         state['name']        = self.name
 *         state['interpolate'] = self.dtype_series.interpolate_type
 */
  __pyx_t_1 = __pyx_v_self->dtype;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_state, __pyx_n_s_dtype, __pyx_t_1) < 0)) __PYX_ERR(1, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":977
 *         state['items']       = self.items()
 *         state['dtype']       = self.dtype
 *         state['name']        = self.name             # <<<<<<<<<<<<<<
 *         state['interpolate'] = self.dtype_series.interpolate_type
 *         state['extrapolate'] = self.dtype_series.extrapolate
 */
  __pyx_t_1 = __pyx_v_self->name;
  __Pyx_INCREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_state, __pyx_n_s_name, __pyx_t_1) < 0)) __PYX_ERR(1, 977, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":978
 *         state['dtype']       = self.dtype
 *         state['name']        = self.name
 *         state['interpolate'] = self.dtype_series.interpolate_type             # <<<<<<<<<<<<<<
 *         state['extrapolate'] = self.dtype_series.extrapolate
 *         state['arithmetic']  = self.dtype_series.arithmetic
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_interpolate_type); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 978, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_state, __pyx_n_s_interpolate, __pyx_t_1) < 0)) __PYX_ERR(1, 978, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":979
 *         state['name']        = self.name
 *         state['interpolate'] = self.dtype_series.interpolate_type
 *         state['extrapolate'] = self.dtype_series.extrapolate             # <<<<<<<<<<<<<<
 *         state['arithmetic']  = self.dtype_series.arithmetic
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 979, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_state, __pyx_n_s_extrapolate, __pyx_t_1) < 0)) __PYX_ERR(1, 979, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":980
 *         state['interpolate'] = self.dtype_series.interpolate_type
 *         state['extrapolate'] = self.dtype_series.extrapolate
 *         state['arithmetic']  = self.dtype_series.arithmetic             # <<<<<<<<<<<<<<
 * 
 *         return state
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self->dtype_series), __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(PyDict_SetItem(__pyx_v_state, __pyx_n_s_arithmetic, __pyx_t_1) < 0)) __PYX_ERR(1, 980, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":982
 *         state['arithmetic']  = self.dtype_series.arithmetic
 * 
 *         return state             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "redblackpy/series/tree_series.pyx":971
 * 
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef dict state = {}
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__getstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pyx":985
 * 
 * 
 *     def __setstate__(self, dict state):             # <<<<<<<<<<<<<<
 * 
 *         self.name = state['name']
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_81__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state); /*proto*/
static char __pyx_doc_10redblackpy_6series_11tree_series_6Series_80__setstate__[] = "Series.__setstate__(self, dict state)";
static PyMethodDef __pyx_mdef_10redblackpy_6series_11tree_series_6Series_81__setstate__ = {"__setstate__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_81__setstate__, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_80__setstate__};
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_81__setstate__(PyObject *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate__ (wrapper)", 0);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_state), (&PyDict_Type), 1, "state", 1))) __PYX_ERR(1, 985, __pyx_L1_error)
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_80__setstate__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject*)__pyx_v_state));

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_80__setstate__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate__", 0);

  /* "redblackpy/series/tree_series.pyx":987
 *     def __setstate__(self, dict state):
 * 
 *         self.name = state['name']             # <<<<<<<<<<<<<<
 *         self.cast_dtype(state['dtype'])
 *         self.set_interpolation(state['interpolate'])
 */
  if (unlikely(__pyx_v_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 987, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 987, __pyx_L1_error)
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":988
 * 
 *         self.name = state['name']
 *         self.cast_dtype(state['dtype'])             # <<<<<<<<<<<<<<
 *         self.set_interpolation(state['interpolate'])
 *         self.set_extrapolation(state['extrapolate'])
 */
  if (unlikely(__pyx_v_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 988, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 988, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 988, __pyx_L1_error)
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->cast_dtype(__pyx_v_self, ((PyObject*)__pyx_t_1), 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 988, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":989
 *         self.name = state['name']
 *         self.cast_dtype(state['dtype'])
 *         self.set_interpolation(state['interpolate'])             # <<<<<<<<<<<<<<
 *         self.set_extrapolation(state['extrapolate'])
 *         self.set_arithmetic(state['arithmetic'])
 */
  if (unlikely(__pyx_v_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 989, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_interpolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 989, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 989, __pyx_L1_error)
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->set_interpolation(__pyx_v_self, ((PyObject*)__pyx_t_1), 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":990
 *         self.cast_dtype(state['dtype'])
 *         self.set_interpolation(state['interpolate'])
 *         self.set_extrapolation(state['extrapolate'])             # <<<<<<<<<<<<<<
 *         self.set_arithmetic(state['arithmetic'])
 *         self.insert_range(state['items'])
 */
  if (unlikely(__pyx_v_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 990, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_extrapolate); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 990, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->set_extrapolation(__pyx_v_self, __pyx_t_1, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":991
 *         self.set_interpolation(state['interpolate'])
 *         self.set_extrapolation(state['extrapolate'])
 *         self.set_arithmetic(state['arithmetic'])             # <<<<<<<<<<<<<<
 *         self.insert_range(state['items'])
 */
  if (unlikely(__pyx_v_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 991, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_arithmetic); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 991, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(1, 991, __pyx_L1_error)
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->set_arithmetic(__pyx_v_self, ((PyObject*)__pyx_t_1), 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":992
 *         self.set_extrapolation(state['extrapolate'])
 *         self.set_arithmetic(state['arithmetic'])
 *         self.insert_range(state['items'])             # <<<<<<<<<<<<<<
 */
  if (unlikely(__pyx_v_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 992, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_n_s_items); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 992, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  ((struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series *)__pyx_v_self->__pyx_vtab)->insert_range(__pyx_v_self, __pyx_t_1, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 992, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "redblackpy/series/tree_series.pyx":985
 * 
 * 
 *     def __setstate__(self, dict state):             # <<<<<<<<<<<<<<
 * 
 *         self.name = state['name']
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.__setstate__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pxd":87
 *     # Attributes
 *     cdef __BaseTreeSeries dtype_series
 *     cdef public   str name             # <<<<<<<<<<<<<<
 *     cdef readonly str dtype
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_4name___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->name);
  __pyx_r = __pyx_v_self->name;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name_2__set__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name_2__set__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__set__", 0);
  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(9, 87, __pyx_L1_error)
  __pyx_t_1 = __pyx_v_value;
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("redblackpy.series.tree_series.Series.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_5__del__(PyObject *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name_4__del__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_10redblackpy_6series_11tree_series_6Series_4name_4__del__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__del__", 0);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->name);
  __Pyx_DECREF(__pyx_v_self->name);
  __pyx_v_self->name = ((PyObject*)Py_None);

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "redblackpy/series/tree_series.pxd":88
 *     cdef __BaseTreeSeries dtype_series
 *     cdef public   str name
 *     cdef readonly str dtype             # <<<<<<<<<<<<<<
 * 
 *     # Methods
 */

/* Python wrapper */
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_5dtype_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_10redblackpy_6series_11tree_series_6Series_5dtype_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_10redblackpy_6series_11tree_series_6Series_5dtype___get__(((struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_10redblackpy_6series_11tree_series_6Series_5dtype___get__(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self->dtype);
  __pyx_r = __pyx_v_self->dtype;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

static std::string __pyx_convert_string_from_py_std__in_string(PyObject *__pyx_v_o) {
  Py_ssize_t __pyx_v_length;
  char const *__pyx_v_data;
  std::string __pyx_r;
  __Pyx_RefNannyDeclarations
  char const *__pyx_t_1;
  __Pyx_RefNannySetupContext("__pyx_convert_string_from_py_std__in_string", 0);

  /* "string.from_py":15
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:
 *     cdef Py_ssize_t length
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)             # <<<<<<<<<<<<<<
 *     return string(data, length)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_AsStringAndSize(__pyx_v_o, (&__pyx_v_length)); if (unlikely(__pyx_t_1 == ((char const *)NULL))) __PYX_ERR(4, 15, __pyx_L1_error)
  __pyx_v_data = __pyx_t_1;

  /* "string.from_py":16
 *     cdef Py_ssize_t length
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 *     return string(data, length)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = std::string(__pyx_v_data, __pyx_v_length);
  goto __pyx_L0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("string.from_py.__pyx_convert_string_from_py_std__in_string", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *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_10redblackpy_6series_11tree_series___BaseTreeSeries *)o);
  p->__pyx_vtab = __pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_3__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___BaseTreeSeries[] = {
  {"empty", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_5empty, METH_NOARGS, 0},
  {"keys", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_7keys, METH_NOARGS, 0},
  {"begin", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_9begin, METH_NOARGS, 0},
  {"end", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_11end, METH_NOARGS, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_13on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_15off_itermode, METH_NOARGS, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_21__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_23__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___BaseTreeSeries = {
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___BaseTreeSeries = {
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__BaseTreeSeries", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___BaseTreeSeries, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___BaseTreeSeries, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___BaseTreeSeries, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series_Series __pyx_vtable_10redblackpy_6series_11tree_series_Series;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series_Series(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *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_10redblackpy_6series_11tree_series_Series *)o);
  p->__pyx_vtab = __pyx_vtabptr_10redblackpy_6series_11tree_series_Series;
  p->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)Py_None); Py_INCREF(Py_None);
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->dtype = ((PyObject*)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series_Series(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *p = (struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->dtype_series);
  Py_CLEAR(p->name);
  Py_CLEAR(p->dtype);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series_Series(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *p = (struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)o;
  if (p->dtype_series) {
    e = (*v)(((PyObject *)p->dtype_series), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10redblackpy_6series_11tree_series_Series(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10redblackpy_6series_11tree_series_Series *p = (struct __pyx_obj_10redblackpy_6series_11tree_series_Series *)o;
  tmp = ((PyObject*)p->dtype_series);
  p->dtype_series = ((struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series_Series(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series_Series(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_6Series_61__setitem__(o, i, v);
  }
  else {
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_6Series_interpolation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_6Series_13interpolation_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_6Series_interpolation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_6Series_13interpolation_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_6Series_extrapolation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_6Series_13extrapolation_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_6Series_extrapolation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_6Series_13extrapolation_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_6Series_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_6Series_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_6Series_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_6Series_10arithmetic_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_6Series_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_6Series_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_6Series_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_6Series_dtype(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_6Series_5dtype_1__get__(o);
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series_Series[] = {
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_19iteritems, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_18iteritems},
  {"from_pandas", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_45from_pandas, METH_VARARGS|METH_KEYWORDS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_44from_pandas},
  {"__del__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_47__del__, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_46__del__},
  {"__reduce__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_77__reduce__, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_76__reduce__},
  {"__getstate__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_79__getstate__, METH_NOARGS, __pyx_doc_10redblackpy_6series_11tree_series_6Series_78__getstate__},
  {"__setstate__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_6Series_81__setstate__, METH_O, __pyx_doc_10redblackpy_6series_11tree_series_6Series_80__setstate__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series_Series[] = {
  {(char *)"interpolation", __pyx_getprop_10redblackpy_6series_11tree_series_6Series_interpolation, __pyx_setprop_10redblackpy_6series_11tree_series_6Series_interpolation, (char *)0, 0},
  {(char *)"extrapolation", __pyx_getprop_10redblackpy_6series_11tree_series_6Series_extrapolation, __pyx_setprop_10redblackpy_6series_11tree_series_6Series_extrapolation, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_6Series_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_6Series_arithmetic, (char *)0, 0},
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_6Series_name, __pyx_setprop_10redblackpy_6series_11tree_series_6Series_name, (char *)"name: str", 0},
  {(char *)"dtype", __pyx_getprop_10redblackpy_6series_11tree_series_6Series_dtype, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Series = {
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_63__add__, /*nb_add*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_65__sub__, /*nb_subtract*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_67__mul__, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_69__div__, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_73__lshift__, /*nb_lshift*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_75__rshift__, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_71__truediv__, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Series = {
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_49__len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series_Series, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_55__contains__, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Series = {
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_49__len__, /*mp_length*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_59__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series_Series, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series_Series = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.Series", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series_Series), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series_Series, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_53__repr__, /*tp_repr*/
  &__pyx_tp_as_number_Series, /*tp_as_number*/
  &__pyx_tp_as_sequence_Series, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Series, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_51__str__, /*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*/
  "Series(index=None, values=None, str dtype='float32', str name='Untitled', str interpolate='floor', extrapolate=0, str arithmetic='left')\n\n    Mapping data structure based on red-black trees. Provides fast queries: \n    insertion, deletion, interpolation with no additional memory use, get item by key, \n    set item by key. It able to keep any Python object or specific numeric type as \n    values. Key type have to provide compare operators. \n    To proccess ordered, dynamic data in efficient way redblackpy.Series \n    is a good choise. It supports main numeric types, has builtin to getitem operator (Series[key]) \n    interpolation methods (floor, ceil, near neighboor, linear, keys only), \n    so we have access at any key even though this key not in index by interpolation \n    (except case of keys only interpolation). It is very usefull in work \n    with time series.\n    ", /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series_Series, /*tp_traverse*/
  __pyx_tp_clear_10redblackpy_6series_11tree_series_Series, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_57__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series_Series, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series_Series, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_6Series_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series_Series, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint8_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint8_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint8_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint8_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_uint8_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint8_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_uint8_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint8_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_uint8_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint8_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_uint8_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_uint8_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint8_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint8_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint8_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint16_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint16_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint16_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint16_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_uint16_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint16_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_uint16_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint16_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_uint16_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint16_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_uint16_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_uint16_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint16_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint16_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint16_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint32_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint32_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint32_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint32_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_uint32_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint32_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_uint32_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint32_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_uint32_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint32_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_uint32_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_uint32_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint32_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint32_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint32_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint64_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint64_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint64_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint64_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_uint64_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint64_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_uint64_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint64_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_uint64_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint64_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_uint64_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_uint64_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint64_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint64_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint64_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint96_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint96_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint96_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint96_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_uint96_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint96_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_uint96_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint96_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_uint96_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint96_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_uint96_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_uint96_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint96_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint96_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint96_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_uint128_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint128_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint128_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint128_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_uint128_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_uint128_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_uint128_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_uint128_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_uint128_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_uint128_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_uint128_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_uint128_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_uint128_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_uint128_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_uint128_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int8_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int8_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int8_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int8_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int8_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int8_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_int8_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int8_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_int8_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int8_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_int8_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int8_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_int8_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_int8_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int8_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int8_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int8_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int16_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int16_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int16_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int16_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int16_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int16_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_int16_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int16_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_int16_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int16_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_int16_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int16_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_int16_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_int16_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int16_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int16_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int16_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int32_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int32_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int32_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int32_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int32_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int32_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_int32_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int32_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_int32_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int32_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_int32_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int32_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_int32_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_int32_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int32_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int32_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int32_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int64_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int64_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int64_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int64_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int64_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int64_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_int64_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int64_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_int64_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int64_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_int64_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int64_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_int64_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_int64_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int64_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int64_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int64_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int96_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int96_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int96_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int96_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int96_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int96_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_int96_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int96_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_int96_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int96_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_int96_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int96_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_int96_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_int96_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int96_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int96_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int96_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_int128_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int128_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int128_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int128_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int128_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int128_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_int128_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_int128_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_int128_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_int128_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_int128_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_int128_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_int128_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_int128_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_int128_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_int128_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_int128_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float32_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float32_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float32_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float32_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float32_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float32_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_float32_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float32_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_float32_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float32_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_float32_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float32_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_float32_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_float32_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float32_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float32_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float32_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float64_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float64_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float64_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float64_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float64_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float64_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_float64_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float64_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_float64_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float64_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_float64_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float64_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_float64_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_float64_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float64_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float64_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float64_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float80_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float80_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float80_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float80_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float80_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float80_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_float80_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float80_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_float80_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float80_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_float80_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float80_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_float80_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_float80_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float80_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float80_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float80_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float96_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float96_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float96_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float96_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float96_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float96_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_float96_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float96_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_float96_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float96_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_float96_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float96_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_float96_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_float96_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float96_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float96_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float96_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_float128_t __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float128_t(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float128_t(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float128_t(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11extrapolate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float128_t[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float128_t[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_name, __pyx_setprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_float128_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_float128_t, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_float128_t = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_float128_t, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_float128_t", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_float128_t, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_float128_t, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_float128_t, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_46__str__, /*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, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_float128_t, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_float128_t, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_float128_t, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};
static struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___TreeSeries_object __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *p;
  PyObject *o = __pyx_tp_new_10redblackpy_6series_11tree_series___BaseTreeSeries(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_10redblackpy_6series_11tree_series___BaseTreeSeries*)__pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object;
  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->arithmetic = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->interpolate_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
  p->extrapolate = Py_None; Py_INCREF(Py_None);
  if (unlikely(__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_3__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_object(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_44__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->name);
  Py_CLEAR(p->arithmetic);
  Py_CLEAR(p->interpolate_type);
  Py_CLEAR(p->extrapolate);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___BaseTreeSeries(o);
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___TreeSeries_object(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)o;
  e = ((likely(__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)) ? ((__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_traverse) ? __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_10redblackpy_6series_11tree_series___TreeSeries_object)); if (e) return e;
  if (p->extrapolate) {
    e = (*v)(p->extrapolate, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_10redblackpy_6series_11tree_series___TreeSeries_object(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *)o;
  if (likely(__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries)) { if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_clear) __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_10redblackpy_6series_11tree_series___TreeSeries_object);
  tmp = ((PyObject*)p->extrapolate);
  p->extrapolate = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}
static PyObject *__pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_object(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static int __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_object(PyObject *o, PyObject *i, PyObject *v) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_55__setitem__(o, i, v);
  }
  else {
    if (__pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping && __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript)
      return __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries->tp_as_mapping->mp_ass_subscript(o, i, v);
    PyErr_Format(PyExc_NotImplementedError,
      "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
    return -1;
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_name(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_4name_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_arithmetic(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_arithmetic(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_10arithmetic_5__del__(o);
  }
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_interpolate_type(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_16interpolate_type_1__get__(o);
}

static PyObject *__pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_extrapolate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_1__get__(o);
}

static int __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_extrapolate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_3__set__(o, v);
  }
  else {
    return __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11extrapolate_5__del__(o);
  }
}

static PyMethodDef __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_object[] = {
  {"insert", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_5insert, METH_VARARGS|METH_KEYWORDS, 0},
  {"insert_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_7insert_range, METH_O, 0},
  {"erase", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_9erase, METH_O, 0},
  {"erase_range", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_11erase_range, METH_O, 0},
  {"values", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_13values, METH_NOARGS, 0},
  {"items", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_15items, METH_NOARGS, 0},
  {"iteritems", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_17iteritems, METH_NOARGS, 0},
  {"floor", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_20floor, METH_O, 0},
  {"ceil", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_22ceil, METH_O, 0},
  {"truncate", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_24truncate, METH_VARARGS|METH_KEYWORDS, 0},
  {"periodic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_26periodic, METH_VARARGS|METH_KEYWORDS, 0},
  {"map", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_28map, METH_VARARGS|METH_KEYWORDS, 0},
  {"map_inplace", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_30map_inplace, METH_VARARGS|METH_KEYWORDS, 0},
  {"set_interpolation", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_32set_interpolation, METH_O, 0},
  {"set_arithmetic", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_34set_arithmetic, METH_O, 0},
  {"on_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_36on_itermode, METH_NOARGS, 0},
  {"off_itermode", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_38off_itermode, METH_NOARGS, 0},
  {"copy_data", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_40copy_data, METH_VARARGS|METH_KEYWORDS, 0},
  {"clear", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_42clear, METH_NOARGS, 0},
  {"add", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_57add, METH_O, 0},
  {"sub", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_59sub, METH_O, 0},
  {"mul", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_61mul, METH_O, 0},
  {"div", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_63div, METH_O, 0},
  {"lshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_65lshift, METH_O, 0},
  {"rshift", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_67rshift, METH_O, 0},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_69__reduce_cython__, METH_NOARGS, 0},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_71__setstate_cython__, METH_O, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_object[] = {
  {(char *)"name", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_name, __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_name, (char *)0, 0},
  {(char *)"arithmetic", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_arithmetic, __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_arithmetic, (char *)0, 0},
  {(char *)"interpolate_type", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_interpolate_type, 0, (char *)0, 0},
  {(char *)"extrapolate", __pyx_getprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_extrapolate, __pyx_setprop_10redblackpy_6series_11tree_series_19__TreeSeries_object_extrapolate, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PySequenceMethods __pyx_tp_as_sequence___TreeSeries_object = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*sq_length*/
  #else
  0, /*sq_length*/
  #endif
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_10redblackpy_6series_11tree_series___TreeSeries_object, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_19__contains__, /*sq_contains*/
  #else
  0, /*sq_contains*/
  #endif
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___TreeSeries_object = {
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_10redblackpy_6series_11tree_series_16__BaseTreeSeries_17__len__, /*mp_length*/
  #else
  0, /*mp_length*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_53__getitem__, /*mp_subscript*/
  __pyx_mp_ass_subscript_10redblackpy_6series_11tree_series___TreeSeries_object, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__TreeSeries_object", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___TreeSeries_object, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_48__repr__, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence___TreeSeries_object, /*tp_as_sequence*/
  &__pyx_tp_as_mapping___TreeSeries_object, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_46__str__, /*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_10redblackpy_6series_11tree_series___TreeSeries_object, /*tp_traverse*/
  __pyx_tp_clear_10redblackpy_6series_11tree_series___TreeSeries_object, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_50__iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_10redblackpy_6series_11tree_series___TreeSeries_object, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_10redblackpy_6series_11tree_series___TreeSeries_object, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_10redblackpy_6series_11tree_series_19__TreeSeries_object_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___TreeSeries_object, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct__iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_1___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_2_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_3___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_4_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_5___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_6_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_7___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_8_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_9___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_10_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_11___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_12_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_13___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_14_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_15___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_16_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_17___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_18_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_19___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_20_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_21___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_22_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_23___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_24_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_25___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_26_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_27___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_28_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_29___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_30_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_31___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_32_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_33___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_34_iteritems", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__[8];
static int __pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ = 0;

static PyObject *__pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *p;
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__)))) {
    o = (PyObject*)__pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__[--__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__];
    memset(o, 0, sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  p = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)o);
  new((void*)&(p->__pyx_t_0)) qseries::rb_tree<__pyx_t_10redblackpy_6series_11tree_series_rb_node_valued,__pyx_t_10redblackpy_6series_11tree_series_c_pyobject> ::iterator();
  return o;
}

static void __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__(PyObject *o) {
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)o;
  PyObject_GC_UnTrack(o);
  __Pyx_call_destructor(p->__pyx_t_0);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__)))) {
    __pyx_freelist_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__[__pyx_freecount_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__++] = ((struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *p = (struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ = {
  PyVarObject_HEAD_INIT(0, 0)
  "redblackpy.series.tree_series.__pyx_scope_struct_35___iter__", /*tp_name*/
  sizeof(struct __pyx_obj_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_tree_series(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_tree_series},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "tree_series",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_Inconsistent_key_type, __pyx_k_Inconsistent_key_type, sizeof(__pyx_k_Inconsistent_key_type), 0, 0, 1, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_kp_s_Index_cannot_be_None_while_value, __pyx_k_Index_cannot_be_None_while_value, sizeof(__pyx_k_Index_cannot_be_None_while_value), 0, 0, 1, 0},
  {&__pyx_kp_s_Index_is_empty, __pyx_k_Index_is_empty, sizeof(__pyx_k_Index_is_empty), 0, 0, 1, 0},
  {&__pyx_kp_s_Index_must_have_the_same_length, __pyx_k_Index_must_have_the_same_length, sizeof(__pyx_k_Index_must_have_the_same_length), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_Series, __pyx_k_Series, sizeof(__pyx_k_Series), 0, 0, 1, 1},
  {&__pyx_n_s_Series___del, __pyx_k_Series___del, sizeof(__pyx_k_Series___del), 0, 0, 1, 1},
  {&__pyx_n_s_Series___getstate, __pyx_k_Series___getstate, sizeof(__pyx_k_Series___getstate), 0, 0, 1, 1},
  {&__pyx_n_s_Series___reduce, __pyx_k_Series___reduce, sizeof(__pyx_k_Series___reduce), 0, 0, 1, 1},
  {&__pyx_n_s_Series___setstate, __pyx_k_Series___setstate, sizeof(__pyx_k_Series___setstate), 0, 0, 1, 1},
  {&__pyx_n_s_Series_begin, __pyx_k_Series_begin, sizeof(__pyx_k_Series_begin), 0, 0, 1, 1},
  {&__pyx_n_s_Series_cast_dtype, __pyx_k_Series_cast_dtype, sizeof(__pyx_k_Series_cast_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_Series_ceil, __pyx_k_Series_ceil, sizeof(__pyx_k_Series_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_Series_end, __pyx_k_Series_end, sizeof(__pyx_k_Series_end), 0, 0, 1, 1},
  {&__pyx_n_s_Series_erase, __pyx_k_Series_erase, sizeof(__pyx_k_Series_erase), 0, 0, 1, 1},
  {&__pyx_n_s_Series_floor, __pyx_k_Series_floor, sizeof(__pyx_k_Series_floor), 0, 0, 1, 1},
  {&__pyx_n_s_Series_from_pandas, __pyx_k_Series_from_pandas, sizeof(__pyx_k_Series_from_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_Series_index, __pyx_k_Series_index, sizeof(__pyx_k_Series_index), 0, 0, 1, 1},
  {&__pyx_n_s_Series_insert, __pyx_k_Series_insert, sizeof(__pyx_k_Series_insert), 0, 0, 1, 1},
  {&__pyx_n_s_Series_insert_range, __pyx_k_Series_insert_range, sizeof(__pyx_k_Series_insert_range), 0, 0, 1, 1},
  {&__pyx_n_s_Series_items, __pyx_k_Series_items, sizeof(__pyx_k_Series_items), 0, 0, 1, 1},
  {&__pyx_n_s_Series_iteritems, __pyx_k_Series_iteritems, sizeof(__pyx_k_Series_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_Series_map, __pyx_k_Series_map, sizeof(__pyx_k_Series_map), 0, 0, 1, 1},
  {&__pyx_kp_s_Series_object, __pyx_k_Series_object, sizeof(__pyx_k_Series_object), 0, 0, 1, 0},
  {&__pyx_n_s_Series_off_itermode, __pyx_k_Series_off_itermode, sizeof(__pyx_k_Series_off_itermode), 0, 0, 1, 1},
  {&__pyx_n_s_Series_on_itermode, __pyx_k_Series_on_itermode, sizeof(__pyx_k_Series_on_itermode), 0, 0, 1, 1},
  {&__pyx_n_s_Series_set_arithmetic, __pyx_k_Series_set_arithmetic, sizeof(__pyx_k_Series_set_arithmetic), 0, 0, 1, 1},
  {&__pyx_n_s_Series_set_extrapolation, __pyx_k_Series_set_extrapolation, sizeof(__pyx_k_Series_set_extrapolation), 0, 0, 1, 1},
  {&__pyx_n_s_Series_set_interpolation, __pyx_k_Series_set_interpolation, sizeof(__pyx_k_Series_set_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_Series_to_pandas, __pyx_k_Series_to_pandas, sizeof(__pyx_k_Series_to_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_Series_truncate, __pyx_k_Series_truncate, sizeof(__pyx_k_Series_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_Series_uniform, __pyx_k_Series_uniform, sizeof(__pyx_k_Series_uniform), 0, 0, 1, 1},
  {&__pyx_n_s_Series_values, __pyx_k_Series_values, sizeof(__pyx_k_Series_values), 0, 0, 1, 1},
  {&__pyx_kp_s_Shift_parameter_must_be_more_tha, __pyx_k_Shift_parameter_must_be_more_tha, sizeof(__pyx_k_Shift_parameter_must_be_more_tha), 0, 0, 1, 0},
  {&__pyx_n_s_TreeSeries_float128_t___iter, __pyx_k_TreeSeries_float128_t___iter, sizeof(__pyx_k_TreeSeries_float128_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float128_t_iteritem, __pyx_k_TreeSeries_float128_t_iteritem, sizeof(__pyx_k_TreeSeries_float128_t_iteritem), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float32_t___iter, __pyx_k_TreeSeries_float32_t___iter, sizeof(__pyx_k_TreeSeries_float32_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float32_t_iteritems, __pyx_k_TreeSeries_float32_t_iteritems, sizeof(__pyx_k_TreeSeries_float32_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float64_t___iter, __pyx_k_TreeSeries_float64_t___iter, sizeof(__pyx_k_TreeSeries_float64_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float64_t_iteritems, __pyx_k_TreeSeries_float64_t_iteritems, sizeof(__pyx_k_TreeSeries_float64_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float80_t___iter, __pyx_k_TreeSeries_float80_t___iter, sizeof(__pyx_k_TreeSeries_float80_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float80_t_iteritems, __pyx_k_TreeSeries_float80_t_iteritems, sizeof(__pyx_k_TreeSeries_float80_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float96_t___iter, __pyx_k_TreeSeries_float96_t___iter, sizeof(__pyx_k_TreeSeries_float96_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_float96_t_iteritems, __pyx_k_TreeSeries_float96_t_iteritems, sizeof(__pyx_k_TreeSeries_float96_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int128_t___iter, __pyx_k_TreeSeries_int128_t___iter, sizeof(__pyx_k_TreeSeries_int128_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int128_t_iteritems, __pyx_k_TreeSeries_int128_t_iteritems, sizeof(__pyx_k_TreeSeries_int128_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int16_t___iter, __pyx_k_TreeSeries_int16_t___iter, sizeof(__pyx_k_TreeSeries_int16_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int16_t_iteritems, __pyx_k_TreeSeries_int16_t_iteritems, sizeof(__pyx_k_TreeSeries_int16_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int32_t___iter, __pyx_k_TreeSeries_int32_t___iter, sizeof(__pyx_k_TreeSeries_int32_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int32_t_iteritems, __pyx_k_TreeSeries_int32_t_iteritems, sizeof(__pyx_k_TreeSeries_int32_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int64_t___iter, __pyx_k_TreeSeries_int64_t___iter, sizeof(__pyx_k_TreeSeries_int64_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int64_t_iteritems, __pyx_k_TreeSeries_int64_t_iteritems, sizeof(__pyx_k_TreeSeries_int64_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int8_t___iter, __pyx_k_TreeSeries_int8_t___iter, sizeof(__pyx_k_TreeSeries_int8_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int8_t_iteritems, __pyx_k_TreeSeries_int8_t_iteritems, sizeof(__pyx_k_TreeSeries_int8_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int96_t___iter, __pyx_k_TreeSeries_int96_t___iter, sizeof(__pyx_k_TreeSeries_int96_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_int96_t_iteritems, __pyx_k_TreeSeries_int96_t_iteritems, sizeof(__pyx_k_TreeSeries_int96_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_object___iter, __pyx_k_TreeSeries_object___iter, sizeof(__pyx_k_TreeSeries_object___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_object_iteritems, __pyx_k_TreeSeries_object_iteritems, sizeof(__pyx_k_TreeSeries_object_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint128_t___iter, __pyx_k_TreeSeries_uint128_t___iter, sizeof(__pyx_k_TreeSeries_uint128_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint128_t_iteritems, __pyx_k_TreeSeries_uint128_t_iteritems, sizeof(__pyx_k_TreeSeries_uint128_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint16_t___iter, __pyx_k_TreeSeries_uint16_t___iter, sizeof(__pyx_k_TreeSeries_uint16_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint16_t_iteritems, __pyx_k_TreeSeries_uint16_t_iteritems, sizeof(__pyx_k_TreeSeries_uint16_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint32_t___iter, __pyx_k_TreeSeries_uint32_t___iter, sizeof(__pyx_k_TreeSeries_uint32_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint32_t_iteritems, __pyx_k_TreeSeries_uint32_t_iteritems, sizeof(__pyx_k_TreeSeries_uint32_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint64_t___iter, __pyx_k_TreeSeries_uint64_t___iter, sizeof(__pyx_k_TreeSeries_uint64_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint64_t_iteritems, __pyx_k_TreeSeries_uint64_t_iteritems, sizeof(__pyx_k_TreeSeries_uint64_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint8_t___iter, __pyx_k_TreeSeries_uint8_t___iter, sizeof(__pyx_k_TreeSeries_uint8_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint8_t_iteritems, __pyx_k_TreeSeries_uint8_t_iteritems, sizeof(__pyx_k_TreeSeries_uint8_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint96_t___iter, __pyx_k_TreeSeries_uint96_t___iter, sizeof(__pyx_k_TreeSeries_uint96_t___iter), 0, 0, 1, 1},
  {&__pyx_n_s_TreeSeries_uint96_t_iteritems, __pyx_k_TreeSeries_uint96_t_iteritems, sizeof(__pyx_k_TreeSeries_uint96_t_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_kp_s_Unsupported_data_type, __pyx_k_Unsupported_data_type, sizeof(__pyx_k_Unsupported_data_type), 0, 0, 1, 0},
  {&__pyx_n_s_Untitled, __pyx_k_Untitled, sizeof(__pyx_k_Untitled), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s__10, __pyx_k__10, sizeof(__pyx_k__10), 0, 0, 1, 0},
  {&__pyx_kp_s__11, __pyx_k__11, sizeof(__pyx_k__11), 0, 0, 1, 0},
  {&__pyx_n_s_add, __pyx_k_add, sizeof(__pyx_k_add), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_arithmetic, __pyx_k_arithmetic, sizeof(__pyx_k_arithmetic), 0, 0, 1, 1},
  {&__pyx_n_s_begin, __pyx_k_begin, sizeof(__pyx_k_begin), 0, 0, 1, 1},
  {&__pyx_n_s_cast_dtype, __pyx_k_cast_dtype, sizeof(__pyx_k_cast_dtype), 0, 0, 1, 1},
  {&__pyx_n_b_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 0, 1},
  {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
  {&__pyx_n_s_clear, __pyx_k_clear, sizeof(__pyx_k_clear), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_contains, __pyx_k_contains, sizeof(__pyx_k_contains), 0, 0, 1, 1},
  {&__pyx_n_s_copy_data, __pyx_k_copy_data, sizeof(__pyx_k_copy_data), 0, 0, 1, 1},
  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
  {&__pyx_n_s_del, __pyx_k_del, sizeof(__pyx_k_del), 0, 0, 1, 1},
  {&__pyx_n_s_div, __pyx_k_div, sizeof(__pyx_k_div), 0, 0, 1, 1},
  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
  {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
  {&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
  {&__pyx_n_s_erase, __pyx_k_erase, sizeof(__pyx_k_erase), 0, 0, 1, 1},
  {&__pyx_n_s_erase_range, __pyx_k_erase_range, sizeof(__pyx_k_erase_range), 0, 0, 1, 1},
  {&__pyx_n_b_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 0, 1},
  {&__pyx_n_s_extrapolate, __pyx_k_extrapolate, sizeof(__pyx_k_extrapolate), 0, 0, 1, 1},
  {&__pyx_n_s_extrapolation, __pyx_k_extrapolation, sizeof(__pyx_k_extrapolation), 0, 0, 1, 1},
  {&__pyx_n_s_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 1, 1},
  {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
  {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
  {&__pyx_n_s_float80, __pyx_k_float80, sizeof(__pyx_k_float80), 0, 0, 1, 1},
  {&__pyx_n_s_float96, __pyx_k_float96, sizeof(__pyx_k_float96), 0, 0, 1, 1},
  {&__pyx_n_b_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 0, 1},
  {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
  {&__pyx_n_b_forward, __pyx_k_forward, sizeof(__pyx_k_forward), 0, 0, 0, 1},
  {&__pyx_n_s_from_pandas, __pyx_k_from_pandas, sizeof(__pyx_k_from_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_inplace, __pyx_k_inplace, sizeof(__pyx_k_inplace), 0, 0, 1, 1},
  {&__pyx_n_s_insert, __pyx_k_insert, sizeof(__pyx_k_insert), 0, 0, 1, 1},
  {&__pyx_n_s_insert_range, __pyx_k_insert_range, sizeof(__pyx_k_insert_range), 0, 0, 1, 1},
  {&__pyx_n_s_int128, __pyx_k_int128, sizeof(__pyx_k_int128), 0, 0, 1, 1},
  {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
  {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
  {&__pyx_n_s_int64, __pyx_k_int64, sizeof(__pyx_k_int64), 0, 0, 1, 1},
  {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
  {&__pyx_n_s_int96, __pyx_k_int96, sizeof(__pyx_k_int96), 0, 0, 1, 1},
  {&__pyx_n_s_interpolate, __pyx_k_interpolate, sizeof(__pyx_k_interpolate), 0, 0, 1, 1},
  {&__pyx_n_s_interpolate_type, __pyx_k_interpolate_type, sizeof(__pyx_k_interpolate_type), 0, 0, 1, 1},
  {&__pyx_n_s_interpolation, __pyx_k_interpolation, sizeof(__pyx_k_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_iter, __pyx_k_iter, sizeof(__pyx_k_iter), 0, 0, 1, 1},
  {&__pyx_n_s_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 0, 0, 1, 1},
  {&__pyx_n_s_key, __pyx_k_key, sizeof(__pyx_k_key), 0, 0, 1, 1},
  {&__pyx_kp_s_key_value, __pyx_k_key_value, sizeof(__pyx_k_key_value), 0, 0, 1, 0},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
  {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
  {&__pyx_n_b_linear, __pyx_k_linear, sizeof(__pyx_k_linear), 0, 0, 0, 1},
  {&__pyx_n_s_lshift, __pyx_k_lshift, sizeof(__pyx_k_lshift), 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_map_inplace, __pyx_k_map_inplace, sizeof(__pyx_k_map_inplace), 0, 0, 1, 1},
  {&__pyx_n_s_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 0, 1, 1},
  {&__pyx_n_s_mul, __pyx_k_mul, sizeof(__pyx_k_mul), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_b_nn, __pyx_k_nn, sizeof(__pyx_k_nn), 0, 0, 0, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_numerical, __pyx_k_numerical, sizeof(__pyx_k_numerical), 0, 0, 1, 1},
  {&__pyx_n_s_object, __pyx_k_object, sizeof(__pyx_k_object), 0, 0, 1, 1},
  {&__pyx_n_s_off_itermode, __pyx_k_off_itermode, sizeof(__pyx_k_off_itermode), 0, 0, 1, 1},
  {&__pyx_n_s_on_itermode, __pyx_k_on_itermode, sizeof(__pyx_k_on_itermode), 0, 0, 1, 1},
  {&__pyx_n_s_other, __pyx_k_other, sizeof(__pyx_k_other), 0, 0, 1, 1},
  {&__pyx_n_s_pairs, __pyx_k_pairs, sizeof(__pyx_k_pairs), 0, 0, 1, 1},
  {&__pyx_n_s_pandas, __pyx_k_pandas, sizeof(__pyx_k_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_pd, __pyx_k_pd, sizeof(__pyx_k_pd), 0, 0, 1, 1},
  {&__pyx_n_s_pd_series, __pyx_k_pd_series, sizeof(__pyx_k_pd_series), 0, 0, 1, 1},
  {&__pyx_n_s_periodic, __pyx_k_periodic, sizeof(__pyx_k_periodic), 0, 0, 1, 1},
  {&__pyx_n_s_pop, __pyx_k_pop, sizeof(__pyx_k_pop), 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_redblackpy_series_tree_series, __pyx_k_redblackpy_series_tree_series, sizeof(__pyx_k_redblackpy_series_tree_series), 0, 0, 1, 1},
  {&__pyx_kp_s_redblackpy_series_tree_series_py, __pyx_k_redblackpy_series_tree_series_py, sizeof(__pyx_k_redblackpy_series_tree_series_py), 0, 0, 1, 0},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_rshift, __pyx_k_rshift, sizeof(__pyx_k_rshift), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_set_arithmetic, __pyx_k_set_arithmetic, sizeof(__pyx_k_set_arithmetic), 0, 0, 1, 1},
  {&__pyx_n_s_set_extrapolation, __pyx_k_set_extrapolation, sizeof(__pyx_k_set_extrapolation), 0, 0, 1, 1},
  {&__pyx_n_s_set_interpolation, __pyx_k_set_interpolation, sizeof(__pyx_k_set_interpolation), 0, 0, 1, 1},
  {&__pyx_n_s_setitem, __pyx_k_setitem, sizeof(__pyx_k_setitem), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_staticmethod, __pyx_k_staticmethod, sizeof(__pyx_k_staticmethod), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
  {&__pyx_n_s_str_2, __pyx_k_str_2, sizeof(__pyx_k_str_2), 0, 0, 1, 1},
  {&__pyx_n_s_sub, __pyx_k_sub, sizeof(__pyx_k_sub), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_to_pandas, __pyx_k_to_pandas, sizeof(__pyx_k_to_pandas), 0, 0, 1, 1},
  {&__pyx_n_s_to_type, __pyx_k_to_type, sizeof(__pyx_k_to_type), 0, 0, 1, 1},
  {&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
  {&__pyx_n_s_uint128, __pyx_k_uint128, sizeof(__pyx_k_uint128), 0, 0, 1, 1},
  {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
  {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
  {&__pyx_n_s_uint64, __pyx_k_uint64, sizeof(__pyx_k_uint64), 0, 0, 1, 1},
  {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
  {&__pyx_n_s_uint96, __pyx_k_uint96, sizeof(__pyx_k_uint96), 0, 0, 1, 1},
  {&__pyx_n_s_uniform, __pyx_k_uniform, sizeof(__pyx_k_uniform), 0, 0, 1, 1},
  {&__pyx_n_s_union, __pyx_k_union, sizeof(__pyx_k_union), 0, 0, 1, 1},
  {&__pyx_n_s_utf8, __pyx_k_utf8, sizeof(__pyx_k_utf8), 0, 0, 1, 1},
  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
  {&__pyx_n_s_values, __pyx_k_values, sizeof(__pyx_k_values), 0, 0, 1, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 22, __pyx_L1_error)
  __pyx_builtin_staticmethod = __Pyx_GetBuiltinName(__pyx_n_s_staticmethod); if (!__pyx_builtin_staticmethod) __PYX_ERR(1, 809, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 45, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 68, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(3, 333, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(3, 400, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 502, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "redblackpy/cython_source/base_tree_series.pxi":45
 * 
 *         if self.__index.size() == 0:
 *             raise IndexError("Index is empty.")             # <<<<<<<<<<<<<<
 * 
 *         return self.__get_key_from_iter( self.__index.begin() )
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Index_is_empty); if (unlikely(!__pyx_tuple_)) __PYX_ERR(2, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "redblackpy/cython_source/base_tree_series.pxi":53
 * 
 *         if self.__index.size() == 0:
 *             raise IndexError("Index is empty.")             # <<<<<<<<<<<<<<
 * 
 *         return self.__get_key_from_iter( self.__index.back() )
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_Index_is_empty); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(2, 53, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":32
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 32, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":111
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__6 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 111, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":125
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__7 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":398
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":502
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":533
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":635
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(3, 635, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":714
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__18 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(3, 714, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":728
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__19 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(3, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1001
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(3, 1001, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1105
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(3, 1105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1136
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(3, 1136, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1238
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(3, 1238, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1317
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__28 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(3, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1331
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__29 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(3, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1604
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(3, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1708
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(3, 1708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1739
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(3, 1739, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1841
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(3, 1841, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1920
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__38 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(3, 1920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1934
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__39 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(3, 1934, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2207
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(3, 2207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2311
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(3, 2311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2342
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(3, 2342, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2444
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(3, 2444, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2523
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__48 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(3, 2523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2537
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__49 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(3, 2537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2810
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(3, 2810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2914
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(3, 2914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2945
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(3, 2945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3047
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(3, 3047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3126
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__58 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(3, 3126, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3140
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__59 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(3, 3140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3413
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(3, 3413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3517
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(3, 3517, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3548
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(3, 3548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3650
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(3, 3650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3729
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__68 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(3, 3729, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3743
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__69 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(3, 3743, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4016
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(3, 4016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4120
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(3, 4120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4151
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(3, 4151, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4253
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(3, 4253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4332
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__78 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(3, 4332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4346
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__79 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(3, 4346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4619
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(3, 4619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4723
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(3, 4723, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4754
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(3, 4754, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4856
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(3, 4856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4935
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__88 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(3, 4935, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4949
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__89 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(3, 4949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5222
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(3, 5222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5326
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(3, 5326, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5357
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(3, 5357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5459
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(3, 5459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5538
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__98 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(3, 5538, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5552
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__99 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(3, 5552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5825
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(3, 5825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5929
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(3, 5929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5960
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(3, 5960, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6062
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(3, 6062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6141
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__108 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(3, 6141, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6155
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__109 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(3, 6155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6428
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(3, 6428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6532
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(3, 6532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6563
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(3, 6563, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6665
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(3, 6665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6744
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__118 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(3, 6744, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6758
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__119 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(3, 6758, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7031
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(3, 7031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7135
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(3, 7135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7166
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(3, 7166, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7268
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(3, 7268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7347
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__128 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(3, 7347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7361
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__129 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(3, 7361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7634
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(3, 7634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7738
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(3, 7738, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7769
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__134 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(3, 7769, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__135 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__136 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7871
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(3, 7871, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7950
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__138 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(3, 7950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7964
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__139 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(3, 7964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8237
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__142 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__142)) __PYX_ERR(3, 8237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__142);
  __Pyx_GIVEREF(__pyx_tuple__142);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8341
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__143 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(3, 8341, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8372
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__144 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__144)) __PYX_ERR(3, 8372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__144);
  __Pyx_GIVEREF(__pyx_tuple__144);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__146 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__146)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__146);
  __Pyx_GIVEREF(__pyx_tuple__146);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8474
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__147 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(3, 8474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8553
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__148 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__148)) __PYX_ERR(3, 8553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__148);
  __Pyx_GIVEREF(__pyx_tuple__148);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8567
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__149 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(3, 8567, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8840
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__152 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__152)) __PYX_ERR(3, 8840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__152);
  __Pyx_GIVEREF(__pyx_tuple__152);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8944
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(3, 8944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8975
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__154 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__154)) __PYX_ERR(3, 8975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__154);
  __Pyx_GIVEREF(__pyx_tuple__154);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__155 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__156 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__156)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__156);
  __Pyx_GIVEREF(__pyx_tuple__156);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9077
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(3, 9077, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9156
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__158 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__158)) __PYX_ERR(3, 9156, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__158);
  __Pyx_GIVEREF(__pyx_tuple__158);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9170
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__159 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(3, 9170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9443
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__162 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__162)) __PYX_ERR(3, 9443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__162);
  __Pyx_GIVEREF(__pyx_tuple__162);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9547
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(3, 9547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9578
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__164 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__164)) __PYX_ERR(3, 9578, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__164);
  __Pyx_GIVEREF(__pyx_tuple__164);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__165 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__166 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__166)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__166);
  __Pyx_GIVEREF(__pyx_tuple__166);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9680
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__167 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(3, 9680, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9759
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__168 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__168)) __PYX_ERR(3, 9759, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__168);
  __Pyx_GIVEREF(__pyx_tuple__168);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9773
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__169 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(3, 9773, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10046
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__172 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__172)) __PYX_ERR(3, 10046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__172);
  __Pyx_GIVEREF(__pyx_tuple__172);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10150
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__173 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(3, 10150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10181
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__174 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__174)) __PYX_ERR(3, 10181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__174);
  __Pyx_GIVEREF(__pyx_tuple__174);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__175 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__176 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__176)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__176);
  __Pyx_GIVEREF(__pyx_tuple__176);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10283
 * 
 *             if values is not None:
 *                 raise IndexError("Index cannot be None while values are not.")             # <<<<<<<<<<<<<<
 * 
 *         else:
 */
  __pyx_tuple__177 = PyTuple_Pack(1, __pyx_kp_s_Index_cannot_be_None_while_value); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(3, 10283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10362
 * 
 *         if bounds.first == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.first),
 */
  __pyx_tuple__178 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__178)) __PYX_ERR(3, 10362, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__178);
  __Pyx_GIVEREF(__pyx_tuple__178);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10376
 * 
 *         if bounds.second == self.link():
 *             return (None, None)             # <<<<<<<<<<<<<<
 * 
 *         return ( self.__get_key_from_ptr(bounds.second),
 */
  __pyx_tuple__179 = PyTuple_Pack(2, Py_None, Py_None); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(3, 10376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10649
 * 
 *         if len(index) != len(values):
 *             raise IndexError("Index must have the same length as values.")             # <<<<<<<<<<<<<<
 * 
 *         for it in zip(index, values):
 */
  __pyx_tuple__182 = PyTuple_Pack(1, __pyx_kp_s_Index_must_have_the_same_length); if (unlikely(!__pyx_tuple__182)) __PYX_ERR(3, 10649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__182);
  __Pyx_GIVEREF(__pyx_tuple__182);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10753
 *                                                arithmetic=self.arithmetic )
 *         if shift_param <= 0:
 *             raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *         for pair in self.iteritems():
 */
  __pyx_tuple__183 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(3, 10753, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10784
 * 
 *             if shift_param <= 0:
 *                 raise ValueError("Shift parameter must be more than zero.")             # <<<<<<<<<<<<<<
 * 
 *             for pair in self.iteritems():
 */
  __pyx_tuple__184 = PyTuple_Pack(1, __pyx_kp_s_Shift_parameter_must_be_more_tha); if (unlikely(!__pyx_tuple__184)) __PYX_ERR(3, 10784, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__184);
  __Pyx_GIVEREF(__pyx_tuple__184);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__185 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(4, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__186 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__186)) __PYX_ERR(4, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__186);
  __Pyx_GIVEREF(__pyx_tuple__186);

  /* "redblackpy/series/tree_series.pyx":231
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef void insert(self, key, value) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert new value at key to series.
 */
  __pyx_tuple__188 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_key, __pyx_n_s_value); if (unlikely(!__pyx_tuple__188)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__188);
  __Pyx_GIVEREF(__pyx_tuple__188);
  __pyx_codeobj__189 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__188, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_insert, 231, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__189)) __PYX_ERR(1, 231, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":240
 * 
 *     @cython.embedsignature(True)
 *     cpdef void insert_range(self, pairs) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert list of tuples (key, value) to series.
 */
  __pyx_tuple__190 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pairs); if (unlikely(!__pyx_tuple__190)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__190);
  __Pyx_GIVEREF(__pyx_tuple__190);
  __pyx_codeobj__191 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__190, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_insert_range, 240, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__191)) __PYX_ERR(1, 240, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":248
 * 
 *     @cython.embedsignature(True)
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Erase element by key.
 */
  __pyx_tuple__192 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__192)) __PYX_ERR(1, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__192);
  __Pyx_GIVEREF(__pyx_tuple__192);
  __pyx_codeobj__193 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__192, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_erase, 248, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__193)) __PYX_ERR(1, 248, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":257
 * 
 *     @cython.embedsignature(True)
 *     cpdef begin(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns first key.
 */
  __pyx_tuple__194 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__194)) __PYX_ERR(1, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__194);
  __Pyx_GIVEREF(__pyx_tuple__194);
  __pyx_codeobj__195 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__194, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_begin, 257, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__195)) __PYX_ERR(1, 257, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":265
 * 
 *     @cython.embedsignature(True)
 *     cpdef end(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns last key.
 */
  __pyx_tuple__196 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__196)) __PYX_ERR(1, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__196);
  __Pyx_GIVEREF(__pyx_tuple__196);
  __pyx_codeobj__197 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__196, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_end, 265, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__197)) __PYX_ERR(1, 265, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":273
 * 
 *     @cython.embedsignature(True)
 *     cpdef list index(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of keys.
 */
  __pyx_tuple__198 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__198)) __PYX_ERR(1, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__198);
  __Pyx_GIVEREF(__pyx_tuple__198);
  __pyx_codeobj__199 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__198, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_index, 273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__199)) __PYX_ERR(1, 273, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":288
 * 
 *     @cython.embedsignature(True)
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of values.
 */
  __pyx_tuple__200 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__200)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__200);
  __Pyx_GIVEREF(__pyx_tuple__200);
  __pyx_codeobj__201 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__200, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_values, 288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__201)) __PYX_ERR(1, 288, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":296
 * 
 *     @cython.embedsignature(True)
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of tuples(key, value).
 */
  __pyx_tuple__202 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__202)) __PYX_ERR(1, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__202);
  __Pyx_GIVEREF(__pyx_tuple__202);
  __pyx_codeobj__203 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__202, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_items, 296, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__203)) __PYX_ERR(1, 296, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":303
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns generator of tuples(key, value).
 */
  __pyx_tuple__204 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__204)) __PYX_ERR(1, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__204);
  __Pyx_GIVEREF(__pyx_tuple__204);
  __pyx_codeobj__205 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__204, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_iteritems, 303, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__205)) __PYX_ERR(1, 303, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":311
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key' <= key
 */
  __pyx_tuple__206 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__206)) __PYX_ERR(1, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__206);
  __Pyx_GIVEREF(__pyx_tuple__206);
  __pyx_codeobj__207 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__206, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_floor, 311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__207)) __PYX_ERR(1, 311, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":320
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key <= key'
 */
  __pyx_tuple__208 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_key); if (unlikely(!__pyx_tuple__208)) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__208);
  __Pyx_GIVEREF(__pyx_tuple__208);
  __pyx_codeobj__209 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__208, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_ceil, 320, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__209)) __PYX_ERR(1, 320, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":329
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series truncate(self, start, stop):             # <<<<<<<<<<<<<<
 *         """
 *         Truncation from start until stop.
 */
  __pyx_tuple__210 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__210)) __PYX_ERR(1, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__210);
  __Pyx_GIVEREF(__pyx_tuple__210);
  __pyx_codeobj__211 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__210, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_truncate, 329, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__211)) __PYX_ERR(1, 329, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":344
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series uniform(self, start, stop, step):             # <<<<<<<<<<<<<<
 *         """
 *         Returns uniform grid Series from start until stop
 */
  __pyx_tuple__212 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_step); if (unlikely(!__pyx_tuple__212)) __PYX_ERR(1, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__212);
  __Pyx_GIVEREF(__pyx_tuple__212);
  __pyx_codeobj__213 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__212, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_uniform, 344, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__213)) __PYX_ERR(1, 344, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":360
 * 
 *     @cython.embedsignature(True)
 *     cpdef map(self, method, bint inplace=False, tuple args=(), dict kwargs={}):             # <<<<<<<<<<<<<<
 *         """
 *         Apply method to each value in series.
 */
  __pyx_tuple__214 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_method, __pyx_n_s_inplace, __pyx_n_s_args, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__214)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__214);
  __Pyx_GIVEREF(__pyx_tuple__214);
  __pyx_codeobj__215 = (PyObject*)__Pyx_PyCode_New(5, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__214, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_map, 360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__215)) __PYX_ERR(1, 360, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":378
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */
  __pyx_tuple__216 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_interpolate); if (unlikely(!__pyx_tuple__216)) __PYX_ERR(1, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__216);
  __Pyx_GIVEREF(__pyx_tuple__216);
  __pyx_codeobj__217 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__216, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_set_interpolation, 378, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__217)) __PYX_ERR(1, 378, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":387
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_extrapolation(self, extrapolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */
  __pyx_tuple__218 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_extrapolate); if (unlikely(!__pyx_tuple__218)) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__218);
  __Pyx_GIVEREF(__pyx_tuple__218);
  __pyx_codeobj__219 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__218, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_set_extrapolation, 387, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__219)) __PYX_ERR(1, 387, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":396
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */
  __pyx_tuple__220 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_arithmetic); if (unlikely(!__pyx_tuple__220)) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__220);
  __Pyx_GIVEREF(__pyx_tuple__220);
  __pyx_codeobj__221 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__220, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_set_arithmetic, 396, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__221)) __PYX_ERR(1, 396, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":405
 * 
 *     @cython.embedsignature(True)
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn on linear search for operator[].
 */
  __pyx_tuple__222 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__222)) __PYX_ERR(1, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__222);
  __Pyx_GIVEREF(__pyx_tuple__222);
  __pyx_codeobj__223 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__222, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_on_itermode, 405, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__223)) __PYX_ERR(1, 405, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":413
 * 
 *     @cython.embedsignature(True)
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn off linear search for operator[].
 */
  __pyx_tuple__224 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__224)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__224);
  __Pyx_GIVEREF(__pyx_tuple__224);
  __pyx_codeobj__225 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__224, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_off_itermode, 413, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__225)) __PYX_ERR(1, 413, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":421
 * 
 *     @cython.embedsignature(True)
 *     cpdef void cast_dtype(self, str dtype) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to specific dtype.
 */
  __pyx_tuple__226 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dtype); if (unlikely(!__pyx_tuple__226)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__226);
  __Pyx_GIVEREF(__pyx_tuple__226);
  __pyx_codeobj__227 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__226, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_cast_dtype, 421, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__227)) __PYX_ERR(1, 421, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":800
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef to_pandas(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to pandas.Series.
 */
  __pyx_tuple__228 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__228)) __PYX_ERR(1, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__228);
  __Pyx_GIVEREF(__pyx_tuple__228);
  __pyx_codeobj__229 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__228, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_to_pandas, 800, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__229)) __PYX_ERR(1, 800, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":810
 * 
 *     @staticmethod
 *     def from_pandas( pd_series, str interpolate='floor', extrapolate=0,             # <<<<<<<<<<<<<<
 *                      str arithmetic='left' ):
 *         """
 */
  __pyx_tuple__230 = PyTuple_Pack(6, __pyx_n_s_pd_series, __pyx_n_s_interpolate, __pyx_n_s_extrapolate, __pyx_n_s_arithmetic, __pyx_n_s_pd, __pyx_n_s_result); if (unlikely(!__pyx_tuple__230)) __PYX_ERR(1, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__230);
  __Pyx_GIVEREF(__pyx_tuple__230);
  __pyx_codeobj__231 = (PyObject*)__Pyx_PyCode_New(4, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__230, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_from_pandas, 810, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__231)) __PYX_ERR(1, 810, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":827
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __del__(self):             # <<<<<<<<<<<<<<
 * 
 *         self.dtype_series.__del__()
 */
  __pyx_tuple__232 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__232)) __PYX_ERR(1, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__232);
  __Pyx_GIVEREF(__pyx_tuple__232);
  __pyx_codeobj__233 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__232, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_del, 827, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__233)) __PYX_ERR(1, 827, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":966
 *     # Pickle serialization
 *     #--------------------------------------------------------------------------------------------------
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 * 
 *         return Series, (), self.__getstate__()
 */
  __pyx_tuple__234 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__234)) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__234);
  __Pyx_GIVEREF(__pyx_tuple__234);
  __pyx_codeobj__235 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__234, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_reduce, 966, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__235)) __PYX_ERR(1, 966, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":971
 * 
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef dict state = {}
 */
  __pyx_tuple__236 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__236)) __PYX_ERR(1, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__236);
  __Pyx_GIVEREF(__pyx_tuple__236);
  __pyx_codeobj__237 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__236, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_getstate, 971, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__237)) __PYX_ERR(1, 971, __pyx_L1_error)

  /* "redblackpy/series/tree_series.pyx":985
 * 
 * 
 *     def __setstate__(self, dict state):             # <<<<<<<<<<<<<<
 * 
 *         self.name = state['name']
 */
  __pyx_tuple__238 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_state); if (unlikely(!__pyx_tuple__238)) __PYX_ERR(1, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__238);
  __Pyx_GIVEREF(__pyx_tuple__238);
  __pyx_codeobj__239 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__238, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_redblackpy_series_tree_series_py, __pyx_n_s_setstate, 985, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__239)) __PYX_ERR(1, 985, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_int_3735928559 = PyInt_FromString((char *)"3735928559", 0, 0); if (unlikely(!__pyx_int_3735928559)) __PYX_ERR(1, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_modinit_global_init_code(void); /*proto*/
static int __Pyx_modinit_variable_export_code(void); /*proto*/
static int __Pyx_modinit_function_export_code(void); /*proto*/
static int __Pyx_modinit_type_init_code(void); /*proto*/
static int __Pyx_modinit_type_import_code(void); /*proto*/
static int __Pyx_modinit_variable_import_code(void); /*proto*/
static int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  if (__Pyx_ExportFunction("to_c_pyobject", (void (*)(void))__pyx_f_10redblackpy_6series_11tree_series_to_c_pyobject, "__pyx_t_10redblackpy_6series_11tree_series_c_pyobject (PyObject *)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("compare_func", (void (*)(void))__pyx_f_10redblackpy_6series_11tree_series_compare_func, "int (__pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &, __pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("equal", (void (*)(void))__pyx_f_10redblackpy_6series_11tree_series_equal, "int (__pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &, __pyx_t_10redblackpy_6series_11tree_series_c_pyobject const &)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("comp_pair", (void (*)(void))__pyx_f_10redblackpy_6series_11tree_series_comp_pair, "int (std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &, std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  if (__Pyx_ExportFunction("equal_pair", (void (*)(void))__pyx_f_10redblackpy_6series_11tree_series_equal_pair, "int (std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &, std::pair<__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr,__pyx_t_10redblackpy_6series_11tree_series_iterator>  const &)") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  __pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries = &__pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.empty = (int (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_empty;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.keys = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_keys;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.begin = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_begin;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.end = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_end;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.get_tree = (__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_get_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.link = (__pyx_t_10redblackpy_6series_11tree_series_node_ptr (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries_link;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.__pyx___get_key_from_ptr = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_node_ptr))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_ptr;
  __pyx_vtable_10redblackpy_6series_11tree_series___BaseTreeSeries.__pyx___get_key_from_iter = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_iterator))__pyx_f_10redblackpy_6series_11tree_series_16__BaseTreeSeries___get_key_from_iter;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries) < 0) __PYX_ERR(2, 10, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries) < 0) __PYX_ERR(2, 10, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "__BaseTreeSeries", (PyObject *)&__pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries) < 0) __PYX_ERR(2, 10, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries) < 0) __PYX_ERR(2, 10, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries = &__pyx_type_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtabptr_10redblackpy_6series_11tree_series_Series = &__pyx_vtable_10redblackpy_6series_11tree_series_Series;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.begin = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_begin;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.end = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_end;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.get_tree = (__pyx_t_10redblackpy_6series_11tree_series_rb_tree_ptr (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *))__pyx_f_10redblackpy_6series_11tree_series_6Series_get_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.index = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_index;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_values;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_items;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series_Series *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.uniform = (struct __pyx_obj_10redblackpy_6series_11tree_series_Series *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_uniform;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.map = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_6Series_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_6Series_map;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.set_extrapolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_set_extrapolation;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.cast_dtype = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_cast_dtype;
  __pyx_vtable_10redblackpy_6series_11tree_series_Series.to_pandas = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series_Series *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_6Series_to_pandas;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series_Series) < 0) __PYX_ERR(1, 48, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series_Series.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series_Series.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series_Series.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series_Series.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_10redblackpy_6series_11tree_series_Series, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(1, 48, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_10redblackpy_6series_11tree_series_6Series___init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_10redblackpy_6series_11tree_series_6Series___init__.doc = __pyx_doc_10redblackpy_6series_11tree_series_6Series___init__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_10redblackpy_6series_11tree_series_6Series___init__;
    }
  }
  #endif
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series_Series.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series_Series) < 0) __PYX_ERR(1, 48, __pyx_L1_error)
  if (PyObject_SetAttrString(__pyx_m, "Series", (PyObject *)&__pyx_type_10redblackpy_6series_11tree_series_Series) < 0) __PYX_ERR(1, 48, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series_Series = &__pyx_type_10redblackpy_6series_11tree_series_Series;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint8_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint8_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_uint8_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t) < 0) __PYX_ERR(3, 2, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint8_t) < 0) __PYX_ERR(3, 2, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t) < 0) __PYX_ERR(3, 2, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint8_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint8_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint16_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint16_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint16_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t) < 0) __PYX_ERR(3, 605, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint16_t) < 0) __PYX_ERR(3, 605, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t) < 0) __PYX_ERR(3, 605, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint16_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint16_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint32_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint32_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint32_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t) < 0) __PYX_ERR(3, 1208, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint32_t) < 0) __PYX_ERR(3, 1208, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t) < 0) __PYX_ERR(3, 1208, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint32_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint32_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint64_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint64_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint64_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t) < 0) __PYX_ERR(3, 1811, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint64_t) < 0) __PYX_ERR(3, 1811, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t) < 0) __PYX_ERR(3, 1811, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint64_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint64_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint96_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint96_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_uint96_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t) < 0) __PYX_ERR(3, 2414, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint96_t) < 0) __PYX_ERR(3, 2414, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t) < 0) __PYX_ERR(3, 2414, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint96_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint96_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_uint128_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_uint128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_uint128_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_uint128_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t) < 0) __PYX_ERR(3, 3017, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_uint128_t) < 0) __PYX_ERR(3, 3017, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t) < 0) __PYX_ERR(3, 3017, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_uint128_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_uint128_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int8_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int8_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int8_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int8_t))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_int8_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t) < 0) __PYX_ERR(3, 3620, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int8_t) < 0) __PYX_ERR(3, 3620, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t) < 0) __PYX_ERR(3, 3620, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int8_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int8_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int16_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int16_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int16_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int16_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int16_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t) < 0) __PYX_ERR(3, 4223, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int16_t) < 0) __PYX_ERR(3, 4223, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t) < 0) __PYX_ERR(3, 4223, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int16_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int16_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int32_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int32_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int32_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t) < 0) __PYX_ERR(3, 4826, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int32_t) < 0) __PYX_ERR(3, 4826, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t) < 0) __PYX_ERR(3, 4826, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int32_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int32_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int64_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int64_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int64_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t) < 0) __PYX_ERR(3, 5429, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int64_t) < 0) __PYX_ERR(3, 5429, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t) < 0) __PYX_ERR(3, 5429, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int64_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int64_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int96_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int96_t))__pyx_f_10redblackpy_6series_11tree_series_20__TreeSeries_int96_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t) < 0) __PYX_ERR(3, 6032, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int96_t) < 0) __PYX_ERR(3, 6032, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t) < 0) __PYX_ERR(3, 6032, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int96_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int96_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_int128_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_int128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_int128_t))__pyx_f_10redblackpy_6series_11tree_series_21__TreeSeries_int128_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t) < 0) __PYX_ERR(3, 6635, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_int128_t) < 0) __PYX_ERR(3, 6635, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t) < 0) __PYX_ERR(3, 6635, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_int128_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_int128_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float32_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float32_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float32_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float32_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float32_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t) < 0) __PYX_ERR(3, 7238, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float32_t) < 0) __PYX_ERR(3, 7238, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t) < 0) __PYX_ERR(3, 7238, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float32_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float32_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float64_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float64_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float64_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float64_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float64_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t) < 0) __PYX_ERR(3, 7841, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float64_t) < 0) __PYX_ERR(3, 7841, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t) < 0) __PYX_ERR(3, 7841, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float64_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float64_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float80_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float80_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float80_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float80_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float80_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t) < 0) __PYX_ERR(3, 8444, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float80_t) < 0) __PYX_ERR(3, 8444, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t) < 0) __PYX_ERR(3, 8444, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float80_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float80_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float96_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float96_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float96_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float96_t))__pyx_f_10redblackpy_6series_11tree_series_22__TreeSeries_float96_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t) < 0) __PYX_ERR(3, 9047, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float96_t) < 0) __PYX_ERR(3, 9047, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t) < 0) __PYX_ERR(3, 9047, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float96_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float96_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___get_item_linear = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___get_item_tree = (__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_float128_t (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_float128_t.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_float128_t *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_float128_t))__pyx_f_10redblackpy_6series_11tree_series_23__TreeSeries_float128_t___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t) < 0) __PYX_ERR(3, 9650, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_float128_t) < 0) __PYX_ERR(3, 9650, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t) < 0) __PYX_ERR(3, 9650, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_float128_t = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_float128_t;
  __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object = &__pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx_base = *__pyx_vtabptr_10redblackpy_6series_11tree_series___BaseTreeSeries;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx_base.on_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_on_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx_base.off_itermode = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_off_itermode;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.insert = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.insert_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_insert_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.erase = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.erase_range = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_erase_range;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.values = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_values;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.items = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_items;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.floor = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_floor;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.ceil = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_ceil;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.truncate = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_truncate;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.periodic = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_periodic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.map = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_map;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.map_inplace = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_map_inplace;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.set_interpolation = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_interpolation;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.set_arithmetic = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_set_arithmetic;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.copy_data = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data *__pyx_optional_args))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_copy_data;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.clear = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_clear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.add = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_add;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.sub = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_sub;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.mul = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_mul;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.div = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_div;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.lshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_lshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.rshift = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, int __pyx_skip_dispatch))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object_rshift;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___init_tree = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___init_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___init_tree_index = (void (*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___init_tree_index;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___get_item_linear = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_linear;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___get_item_tree = (PyObject *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_tree;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___get_item_slice = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, PyObject *))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___get_item_slice;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___lshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___lshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___rshift_int = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, Py_ssize_t))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___rshift_int;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___arithmetic_left = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___arithmetic_left;
  __pyx_vtable_10redblackpy_6series_11tree_series___TreeSeries_object.__pyx___arithmetic_union = (struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *(*)(struct __pyx_obj_10redblackpy_6series_11tree_series___TreeSeries_object *, struct __pyx_obj_10redblackpy_6series_11tree_series___BaseTreeSeries *, __pyx_t_10redblackpy_6series_11tree_series_arithmetic_object))__pyx_f_10redblackpy_6series_11tree_series_19__TreeSeries_object___arithmetic_union;
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object.tp_base = __pyx_ptype_10redblackpy_6series_11tree_series___BaseTreeSeries;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object) < 0) __PYX_ERR(3, 10253, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object.tp_dict, __pyx_vtabptr_10redblackpy_6series_11tree_series___TreeSeries_object) < 0) __PYX_ERR(3, 10253, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object) < 0) __PYX_ERR(3, 10253, __pyx_L1_error)
  __pyx_ptype_10redblackpy_6series_11tree_series___TreeSeries_object = &__pyx_type_10redblackpy_6series_11tree_series___TreeSeries_object;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems) < 0) __PYX_ERR(3, 95, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct__iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__) < 0) __PYX_ERR(3, 308, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_1___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems) < 0) __PYX_ERR(3, 698, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_2_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__) < 0) __PYX_ERR(3, 911, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_3___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems) < 0) __PYX_ERR(3, 1301, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_4_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__) < 0) __PYX_ERR(3, 1514, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_5___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems) < 0) __PYX_ERR(3, 1904, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_6_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__) < 0) __PYX_ERR(3, 2117, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_7___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems) < 0) __PYX_ERR(3, 2507, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_8_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__) < 0) __PYX_ERR(3, 2720, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_9___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems) < 0) __PYX_ERR(3, 3110, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_10_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__) < 0) __PYX_ERR(3, 3323, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_11___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems) < 0) __PYX_ERR(3, 3713, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_12_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__) < 0) __PYX_ERR(3, 3926, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_13___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems) < 0) __PYX_ERR(3, 4316, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_14_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__) < 0) __PYX_ERR(3, 4529, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_15___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems) < 0) __PYX_ERR(3, 4919, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_16_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__) < 0) __PYX_ERR(3, 5132, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_17___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems) < 0) __PYX_ERR(3, 5522, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_18_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__) < 0) __PYX_ERR(3, 5735, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_19___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems) < 0) __PYX_ERR(3, 6125, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_20_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__) < 0) __PYX_ERR(3, 6338, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_21___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems) < 0) __PYX_ERR(3, 6728, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_22_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__) < 0) __PYX_ERR(3, 6941, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_23___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems) < 0) __PYX_ERR(3, 7331, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_24_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__) < 0) __PYX_ERR(3, 7544, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_25___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems) < 0) __PYX_ERR(3, 7934, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_26_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__) < 0) __PYX_ERR(3, 8147, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_27___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems) < 0) __PYX_ERR(3, 8537, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_28_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__) < 0) __PYX_ERR(3, 8750, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_29___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems) < 0) __PYX_ERR(3, 9140, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_30_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__) < 0) __PYX_ERR(3, 9353, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_31___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems) < 0) __PYX_ERR(3, 9743, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_32_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__) < 0) __PYX_ERR(3, 9956, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_33___iter__;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems) < 0) __PYX_ERR(3, 10346, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_34_iteritems;
  if (PyType_Ready(&__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__) < 0) __PYX_ERR(3, 10559, __pyx_L1_error)
  __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__.tp_print = 0;
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__.tp_dictoffset && __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__ = &__pyx_type_10redblackpy_6series_11tree_series___pyx_scope_struct_35___iter__;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", 
  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
  sizeof(PyTypeObject),
  #else
  sizeof(PyHeapTypeObject),
  #endif
  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(10, 9, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
    #define CYTHON_SMALL_CODE __attribute__((optimize("Os")))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC inittree_series(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC inittree_series(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_tree_series(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_tree_series(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        result = PyDict_SetItemString(moddict, to_name, value);
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static int __pyx_pymod_exec_tree_series(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  std::string __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_tree_series(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("tree_series", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
  #if CYTHON_COMPILING_IN_PYPY
  Py_INCREF(__pyx_b);
  #endif
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_redblackpy__series__tree_series) {
    if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "redblackpy.series.tree_series")) {
      if (unlikely(PyDict_SetItemString(modules, "redblackpy.series.tree_series", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  if (unlikely(__Pyx_modinit_function_export_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  #endif

  /* "redblackpy/cython_source/interpolation.pxi":95
 * 
 * cdef unordered_map[string, interpolate_uint8_t] __INTERPOLATE_uint8_t
 * __INTERPOLATE_uint8_t["floor"]  = &__interpolate_floor_uint8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint8_t["ceil"]   = &__interpolate_ceil_uint8_t
 * __INTERPOLATE_uint8_t["nn"]     = &__interpolate_nn_uint8_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 95, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint8_t);

  /* "redblackpy/cython_source/interpolation.pxi":96
 * cdef unordered_map[string, interpolate_uint8_t] __INTERPOLATE_uint8_t
 * __INTERPOLATE_uint8_t["floor"]  = &__interpolate_floor_uint8_t
 * __INTERPOLATE_uint8_t["ceil"]   = &__interpolate_ceil_uint8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint8_t["nn"]     = &__interpolate_nn_uint8_t
 * __INTERPOLATE_uint8_t["linear"] = &__interpolate_linear_uint8_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 96, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint8_t);

  /* "redblackpy/cython_source/interpolation.pxi":97
 * __INTERPOLATE_uint8_t["floor"]  = &__interpolate_floor_uint8_t
 * __INTERPOLATE_uint8_t["ceil"]   = &__interpolate_ceil_uint8_t
 * __INTERPOLATE_uint8_t["nn"]     = &__interpolate_nn_uint8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint8_t["linear"] = &__interpolate_linear_uint8_t
 * __INTERPOLATE_uint8_t["error"]  = &__interpolate_keys_only_uint8_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 97, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint8_t);

  /* "redblackpy/cython_source/interpolation.pxi":98
 * __INTERPOLATE_uint8_t["ceil"]   = &__interpolate_ceil_uint8_t
 * __INTERPOLATE_uint8_t["nn"]     = &__interpolate_nn_uint8_t
 * __INTERPOLATE_uint8_t["linear"] = &__interpolate_linear_uint8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint8_t["error"]  = &__interpolate_keys_only_uint8_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 98, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint8_t);

  /* "redblackpy/cython_source/interpolation.pxi":99
 * __INTERPOLATE_uint8_t["nn"]     = &__interpolate_nn_uint8_t
 * __INTERPOLATE_uint8_t["linear"] = &__interpolate_linear_uint8_t
 * __INTERPOLATE_uint8_t["error"]  = &__interpolate_keys_only_uint8_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 99, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint8_t);

  /* "redblackpy/cython_source/interpolation.pxi":194
 * 
 * cdef unordered_map[string, interpolate_uint16_t] __INTERPOLATE_uint16_t
 * __INTERPOLATE_uint16_t["floor"]  = &__interpolate_floor_uint16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint16_t["ceil"]   = &__interpolate_ceil_uint16_t
 * __INTERPOLATE_uint16_t["nn"]     = &__interpolate_nn_uint16_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 194, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint16_t);

  /* "redblackpy/cython_source/interpolation.pxi":195
 * cdef unordered_map[string, interpolate_uint16_t] __INTERPOLATE_uint16_t
 * __INTERPOLATE_uint16_t["floor"]  = &__interpolate_floor_uint16_t
 * __INTERPOLATE_uint16_t["ceil"]   = &__interpolate_ceil_uint16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint16_t["nn"]     = &__interpolate_nn_uint16_t
 * __INTERPOLATE_uint16_t["linear"] = &__interpolate_linear_uint16_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 195, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint16_t);

  /* "redblackpy/cython_source/interpolation.pxi":196
 * __INTERPOLATE_uint16_t["floor"]  = &__interpolate_floor_uint16_t
 * __INTERPOLATE_uint16_t["ceil"]   = &__interpolate_ceil_uint16_t
 * __INTERPOLATE_uint16_t["nn"]     = &__interpolate_nn_uint16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint16_t["linear"] = &__interpolate_linear_uint16_t
 * __INTERPOLATE_uint16_t["error"]  = &__interpolate_keys_only_uint16_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 196, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint16_t);

  /* "redblackpy/cython_source/interpolation.pxi":197
 * __INTERPOLATE_uint16_t["ceil"]   = &__interpolate_ceil_uint16_t
 * __INTERPOLATE_uint16_t["nn"]     = &__interpolate_nn_uint16_t
 * __INTERPOLATE_uint16_t["linear"] = &__interpolate_linear_uint16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint16_t["error"]  = &__interpolate_keys_only_uint16_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 197, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint16_t);

  /* "redblackpy/cython_source/interpolation.pxi":198
 * __INTERPOLATE_uint16_t["nn"]     = &__interpolate_nn_uint16_t
 * __INTERPOLATE_uint16_t["linear"] = &__interpolate_linear_uint16_t
 * __INTERPOLATE_uint16_t["error"]  = &__interpolate_keys_only_uint16_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 198, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint16_t);

  /* "redblackpy/cython_source/interpolation.pxi":293
 * 
 * cdef unordered_map[string, interpolate_uint32_t] __INTERPOLATE_uint32_t
 * __INTERPOLATE_uint32_t["floor"]  = &__interpolate_floor_uint32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint32_t["ceil"]   = &__interpolate_ceil_uint32_t
 * __INTERPOLATE_uint32_t["nn"]     = &__interpolate_nn_uint32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 293, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint32_t);

  /* "redblackpy/cython_source/interpolation.pxi":294
 * cdef unordered_map[string, interpolate_uint32_t] __INTERPOLATE_uint32_t
 * __INTERPOLATE_uint32_t["floor"]  = &__interpolate_floor_uint32_t
 * __INTERPOLATE_uint32_t["ceil"]   = &__interpolate_ceil_uint32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint32_t["nn"]     = &__interpolate_nn_uint32_t
 * __INTERPOLATE_uint32_t["linear"] = &__interpolate_linear_uint32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 294, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint32_t);

  /* "redblackpy/cython_source/interpolation.pxi":295
 * __INTERPOLATE_uint32_t["floor"]  = &__interpolate_floor_uint32_t
 * __INTERPOLATE_uint32_t["ceil"]   = &__interpolate_ceil_uint32_t
 * __INTERPOLATE_uint32_t["nn"]     = &__interpolate_nn_uint32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint32_t["linear"] = &__interpolate_linear_uint32_t
 * __INTERPOLATE_uint32_t["error"]  = &__interpolate_keys_only_uint32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 295, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint32_t);

  /* "redblackpy/cython_source/interpolation.pxi":296
 * __INTERPOLATE_uint32_t["ceil"]   = &__interpolate_ceil_uint32_t
 * __INTERPOLATE_uint32_t["nn"]     = &__interpolate_nn_uint32_t
 * __INTERPOLATE_uint32_t["linear"] = &__interpolate_linear_uint32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint32_t["error"]  = &__interpolate_keys_only_uint32_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 296, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint32_t);

  /* "redblackpy/cython_source/interpolation.pxi":297
 * __INTERPOLATE_uint32_t["nn"]     = &__interpolate_nn_uint32_t
 * __INTERPOLATE_uint32_t["linear"] = &__interpolate_linear_uint32_t
 * __INTERPOLATE_uint32_t["error"]  = &__interpolate_keys_only_uint32_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 297, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint32_t);

  /* "redblackpy/cython_source/interpolation.pxi":392
 * 
 * cdef unordered_map[string, interpolate_uint64_t] __INTERPOLATE_uint64_t
 * __INTERPOLATE_uint64_t["floor"]  = &__interpolate_floor_uint64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint64_t["ceil"]   = &__interpolate_ceil_uint64_t
 * __INTERPOLATE_uint64_t["nn"]     = &__interpolate_nn_uint64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 392, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint64_t);

  /* "redblackpy/cython_source/interpolation.pxi":393
 * cdef unordered_map[string, interpolate_uint64_t] __INTERPOLATE_uint64_t
 * __INTERPOLATE_uint64_t["floor"]  = &__interpolate_floor_uint64_t
 * __INTERPOLATE_uint64_t["ceil"]   = &__interpolate_ceil_uint64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint64_t["nn"]     = &__interpolate_nn_uint64_t
 * __INTERPOLATE_uint64_t["linear"] = &__interpolate_linear_uint64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 393, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint64_t);

  /* "redblackpy/cython_source/interpolation.pxi":394
 * __INTERPOLATE_uint64_t["floor"]  = &__interpolate_floor_uint64_t
 * __INTERPOLATE_uint64_t["ceil"]   = &__interpolate_ceil_uint64_t
 * __INTERPOLATE_uint64_t["nn"]     = &__interpolate_nn_uint64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint64_t["linear"] = &__interpolate_linear_uint64_t
 * __INTERPOLATE_uint64_t["error"]  = &__interpolate_keys_only_uint64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 394, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint64_t);

  /* "redblackpy/cython_source/interpolation.pxi":395
 * __INTERPOLATE_uint64_t["ceil"]   = &__interpolate_ceil_uint64_t
 * __INTERPOLATE_uint64_t["nn"]     = &__interpolate_nn_uint64_t
 * __INTERPOLATE_uint64_t["linear"] = &__interpolate_linear_uint64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint64_t["error"]  = &__interpolate_keys_only_uint64_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 395, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint64_t);

  /* "redblackpy/cython_source/interpolation.pxi":396
 * __INTERPOLATE_uint64_t["nn"]     = &__interpolate_nn_uint64_t
 * __INTERPOLATE_uint64_t["linear"] = &__interpolate_linear_uint64_t
 * __INTERPOLATE_uint64_t["error"]  = &__interpolate_keys_only_uint64_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 396, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint64_t);

  /* "redblackpy/cython_source/interpolation.pxi":491
 * 
 * cdef unordered_map[string, interpolate_uint96_t] __INTERPOLATE_uint96_t
 * __INTERPOLATE_uint96_t["floor"]  = &__interpolate_floor_uint96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint96_t["ceil"]   = &__interpolate_ceil_uint96_t
 * __INTERPOLATE_uint96_t["nn"]     = &__interpolate_nn_uint96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 491, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint96_t);

  /* "redblackpy/cython_source/interpolation.pxi":492
 * cdef unordered_map[string, interpolate_uint96_t] __INTERPOLATE_uint96_t
 * __INTERPOLATE_uint96_t["floor"]  = &__interpolate_floor_uint96_t
 * __INTERPOLATE_uint96_t["ceil"]   = &__interpolate_ceil_uint96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint96_t["nn"]     = &__interpolate_nn_uint96_t
 * __INTERPOLATE_uint96_t["linear"] = &__interpolate_linear_uint96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 492, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint96_t);

  /* "redblackpy/cython_source/interpolation.pxi":493
 * __INTERPOLATE_uint96_t["floor"]  = &__interpolate_floor_uint96_t
 * __INTERPOLATE_uint96_t["ceil"]   = &__interpolate_ceil_uint96_t
 * __INTERPOLATE_uint96_t["nn"]     = &__interpolate_nn_uint96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint96_t["linear"] = &__interpolate_linear_uint96_t
 * __INTERPOLATE_uint96_t["error"]  = &__interpolate_keys_only_uint96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 493, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint96_t);

  /* "redblackpy/cython_source/interpolation.pxi":494
 * __INTERPOLATE_uint96_t["ceil"]   = &__interpolate_ceil_uint96_t
 * __INTERPOLATE_uint96_t["nn"]     = &__interpolate_nn_uint96_t
 * __INTERPOLATE_uint96_t["linear"] = &__interpolate_linear_uint96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint96_t["error"]  = &__interpolate_keys_only_uint96_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 494, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint96_t);

  /* "redblackpy/cython_source/interpolation.pxi":495
 * __INTERPOLATE_uint96_t["nn"]     = &__interpolate_nn_uint96_t
 * __INTERPOLATE_uint96_t["linear"] = &__interpolate_linear_uint96_t
 * __INTERPOLATE_uint96_t["error"]  = &__interpolate_keys_only_uint96_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 495, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint96_t);

  /* "redblackpy/cython_source/interpolation.pxi":590
 * 
 * cdef unordered_map[string, interpolate_uint128_t] __INTERPOLATE_uint128_t
 * __INTERPOLATE_uint128_t["floor"]  = &__interpolate_floor_uint128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint128_t["ceil"]   = &__interpolate_ceil_uint128_t
 * __INTERPOLATE_uint128_t["nn"]     = &__interpolate_nn_uint128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 590, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_uint128_t);

  /* "redblackpy/cython_source/interpolation.pxi":591
 * cdef unordered_map[string, interpolate_uint128_t] __INTERPOLATE_uint128_t
 * __INTERPOLATE_uint128_t["floor"]  = &__interpolate_floor_uint128_t
 * __INTERPOLATE_uint128_t["ceil"]   = &__interpolate_ceil_uint128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint128_t["nn"]     = &__interpolate_nn_uint128_t
 * __INTERPOLATE_uint128_t["linear"] = &__interpolate_linear_uint128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 591, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_uint128_t);

  /* "redblackpy/cython_source/interpolation.pxi":592
 * __INTERPOLATE_uint128_t["floor"]  = &__interpolate_floor_uint128_t
 * __INTERPOLATE_uint128_t["ceil"]   = &__interpolate_ceil_uint128_t
 * __INTERPOLATE_uint128_t["nn"]     = &__interpolate_nn_uint128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint128_t["linear"] = &__interpolate_linear_uint128_t
 * __INTERPOLATE_uint128_t["error"]  = &__interpolate_keys_only_uint128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 592, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_uint128_t);

  /* "redblackpy/cython_source/interpolation.pxi":593
 * __INTERPOLATE_uint128_t["ceil"]   = &__interpolate_ceil_uint128_t
 * __INTERPOLATE_uint128_t["nn"]     = &__interpolate_nn_uint128_t
 * __INTERPOLATE_uint128_t["linear"] = &__interpolate_linear_uint128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_uint128_t["error"]  = &__interpolate_keys_only_uint128_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 593, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_uint128_t);

  /* "redblackpy/cython_source/interpolation.pxi":594
 * __INTERPOLATE_uint128_t["nn"]     = &__interpolate_nn_uint128_t
 * __INTERPOLATE_uint128_t["linear"] = &__interpolate_linear_uint128_t
 * __INTERPOLATE_uint128_t["error"]  = &__interpolate_keys_only_uint128_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 594, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_uint128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_uint128_t);

  /* "redblackpy/cython_source/interpolation.pxi":689
 * 
 * cdef unordered_map[string, interpolate_int8_t] __INTERPOLATE_int8_t
 * __INTERPOLATE_int8_t["floor"]  = &__interpolate_floor_int8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int8_t["ceil"]   = &__interpolate_ceil_int8_t
 * __INTERPOLATE_int8_t["nn"]     = &__interpolate_nn_int8_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 689, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int8_t);

  /* "redblackpy/cython_source/interpolation.pxi":690
 * cdef unordered_map[string, interpolate_int8_t] __INTERPOLATE_int8_t
 * __INTERPOLATE_int8_t["floor"]  = &__interpolate_floor_int8_t
 * __INTERPOLATE_int8_t["ceil"]   = &__interpolate_ceil_int8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int8_t["nn"]     = &__interpolate_nn_int8_t
 * __INTERPOLATE_int8_t["linear"] = &__interpolate_linear_int8_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 690, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int8_t);

  /* "redblackpy/cython_source/interpolation.pxi":691
 * __INTERPOLATE_int8_t["floor"]  = &__interpolate_floor_int8_t
 * __INTERPOLATE_int8_t["ceil"]   = &__interpolate_ceil_int8_t
 * __INTERPOLATE_int8_t["nn"]     = &__interpolate_nn_int8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int8_t["linear"] = &__interpolate_linear_int8_t
 * __INTERPOLATE_int8_t["error"]  = &__interpolate_keys_only_int8_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 691, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int8_t);

  /* "redblackpy/cython_source/interpolation.pxi":692
 * __INTERPOLATE_int8_t["ceil"]   = &__interpolate_ceil_int8_t
 * __INTERPOLATE_int8_t["nn"]     = &__interpolate_nn_int8_t
 * __INTERPOLATE_int8_t["linear"] = &__interpolate_linear_int8_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int8_t["error"]  = &__interpolate_keys_only_int8_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 692, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int8_t);

  /* "redblackpy/cython_source/interpolation.pxi":693
 * __INTERPOLATE_int8_t["nn"]     = &__interpolate_nn_int8_t
 * __INTERPOLATE_int8_t["linear"] = &__interpolate_linear_int8_t
 * __INTERPOLATE_int8_t["error"]  = &__interpolate_keys_only_int8_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 693, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int8_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int8_t);

  /* "redblackpy/cython_source/interpolation.pxi":788
 * 
 * cdef unordered_map[string, interpolate_int16_t] __INTERPOLATE_int16_t
 * __INTERPOLATE_int16_t["floor"]  = &__interpolate_floor_int16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int16_t["ceil"]   = &__interpolate_ceil_int16_t
 * __INTERPOLATE_int16_t["nn"]     = &__interpolate_nn_int16_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 788, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int16_t);

  /* "redblackpy/cython_source/interpolation.pxi":789
 * cdef unordered_map[string, interpolate_int16_t] __INTERPOLATE_int16_t
 * __INTERPOLATE_int16_t["floor"]  = &__interpolate_floor_int16_t
 * __INTERPOLATE_int16_t["ceil"]   = &__interpolate_ceil_int16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int16_t["nn"]     = &__interpolate_nn_int16_t
 * __INTERPOLATE_int16_t["linear"] = &__interpolate_linear_int16_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 789, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int16_t);

  /* "redblackpy/cython_source/interpolation.pxi":790
 * __INTERPOLATE_int16_t["floor"]  = &__interpolate_floor_int16_t
 * __INTERPOLATE_int16_t["ceil"]   = &__interpolate_ceil_int16_t
 * __INTERPOLATE_int16_t["nn"]     = &__interpolate_nn_int16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int16_t["linear"] = &__interpolate_linear_int16_t
 * __INTERPOLATE_int16_t["error"]  = &__interpolate_keys_only_int16_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 790, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int16_t);

  /* "redblackpy/cython_source/interpolation.pxi":791
 * __INTERPOLATE_int16_t["ceil"]   = &__interpolate_ceil_int16_t
 * __INTERPOLATE_int16_t["nn"]     = &__interpolate_nn_int16_t
 * __INTERPOLATE_int16_t["linear"] = &__interpolate_linear_int16_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int16_t["error"]  = &__interpolate_keys_only_int16_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 791, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int16_t);

  /* "redblackpy/cython_source/interpolation.pxi":792
 * __INTERPOLATE_int16_t["nn"]     = &__interpolate_nn_int16_t
 * __INTERPOLATE_int16_t["linear"] = &__interpolate_linear_int16_t
 * __INTERPOLATE_int16_t["error"]  = &__interpolate_keys_only_int16_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 792, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int16_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int16_t);

  /* "redblackpy/cython_source/interpolation.pxi":887
 * 
 * cdef unordered_map[string, interpolate_int32_t] __INTERPOLATE_int32_t
 * __INTERPOLATE_int32_t["floor"]  = &__interpolate_floor_int32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int32_t["ceil"]   = &__interpolate_ceil_int32_t
 * __INTERPOLATE_int32_t["nn"]     = &__interpolate_nn_int32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 887, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int32_t);

  /* "redblackpy/cython_source/interpolation.pxi":888
 * cdef unordered_map[string, interpolate_int32_t] __INTERPOLATE_int32_t
 * __INTERPOLATE_int32_t["floor"]  = &__interpolate_floor_int32_t
 * __INTERPOLATE_int32_t["ceil"]   = &__interpolate_ceil_int32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int32_t["nn"]     = &__interpolate_nn_int32_t
 * __INTERPOLATE_int32_t["linear"] = &__interpolate_linear_int32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 888, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int32_t);

  /* "redblackpy/cython_source/interpolation.pxi":889
 * __INTERPOLATE_int32_t["floor"]  = &__interpolate_floor_int32_t
 * __INTERPOLATE_int32_t["ceil"]   = &__interpolate_ceil_int32_t
 * __INTERPOLATE_int32_t["nn"]     = &__interpolate_nn_int32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int32_t["linear"] = &__interpolate_linear_int32_t
 * __INTERPOLATE_int32_t["error"]  = &__interpolate_keys_only_int32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 889, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int32_t);

  /* "redblackpy/cython_source/interpolation.pxi":890
 * __INTERPOLATE_int32_t["ceil"]   = &__interpolate_ceil_int32_t
 * __INTERPOLATE_int32_t["nn"]     = &__interpolate_nn_int32_t
 * __INTERPOLATE_int32_t["linear"] = &__interpolate_linear_int32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int32_t["error"]  = &__interpolate_keys_only_int32_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 890, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int32_t);

  /* "redblackpy/cython_source/interpolation.pxi":891
 * __INTERPOLATE_int32_t["nn"]     = &__interpolate_nn_int32_t
 * __INTERPOLATE_int32_t["linear"] = &__interpolate_linear_int32_t
 * __INTERPOLATE_int32_t["error"]  = &__interpolate_keys_only_int32_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 891, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int32_t);

  /* "redblackpy/cython_source/interpolation.pxi":986
 * 
 * cdef unordered_map[string, interpolate_int64_t] __INTERPOLATE_int64_t
 * __INTERPOLATE_int64_t["floor"]  = &__interpolate_floor_int64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int64_t["ceil"]   = &__interpolate_ceil_int64_t
 * __INTERPOLATE_int64_t["nn"]     = &__interpolate_nn_int64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 986, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int64_t);

  /* "redblackpy/cython_source/interpolation.pxi":987
 * cdef unordered_map[string, interpolate_int64_t] __INTERPOLATE_int64_t
 * __INTERPOLATE_int64_t["floor"]  = &__interpolate_floor_int64_t
 * __INTERPOLATE_int64_t["ceil"]   = &__interpolate_ceil_int64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int64_t["nn"]     = &__interpolate_nn_int64_t
 * __INTERPOLATE_int64_t["linear"] = &__interpolate_linear_int64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 987, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int64_t);

  /* "redblackpy/cython_source/interpolation.pxi":988
 * __INTERPOLATE_int64_t["floor"]  = &__interpolate_floor_int64_t
 * __INTERPOLATE_int64_t["ceil"]   = &__interpolate_ceil_int64_t
 * __INTERPOLATE_int64_t["nn"]     = &__interpolate_nn_int64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int64_t["linear"] = &__interpolate_linear_int64_t
 * __INTERPOLATE_int64_t["error"]  = &__interpolate_keys_only_int64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 988, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int64_t);

  /* "redblackpy/cython_source/interpolation.pxi":989
 * __INTERPOLATE_int64_t["ceil"]   = &__interpolate_ceil_int64_t
 * __INTERPOLATE_int64_t["nn"]     = &__interpolate_nn_int64_t
 * __INTERPOLATE_int64_t["linear"] = &__interpolate_linear_int64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int64_t["error"]  = &__interpolate_keys_only_int64_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 989, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int64_t);

  /* "redblackpy/cython_source/interpolation.pxi":990
 * __INTERPOLATE_int64_t["nn"]     = &__interpolate_nn_int64_t
 * __INTERPOLATE_int64_t["linear"] = &__interpolate_linear_int64_t
 * __INTERPOLATE_int64_t["error"]  = &__interpolate_keys_only_int64_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 990, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int64_t);

  /* "redblackpy/cython_source/interpolation.pxi":1085
 * 
 * cdef unordered_map[string, interpolate_int96_t] __INTERPOLATE_int96_t
 * __INTERPOLATE_int96_t["floor"]  = &__interpolate_floor_int96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int96_t["ceil"]   = &__interpolate_ceil_int96_t
 * __INTERPOLATE_int96_t["nn"]     = &__interpolate_nn_int96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1085, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1086
 * cdef unordered_map[string, interpolate_int96_t] __INTERPOLATE_int96_t
 * __INTERPOLATE_int96_t["floor"]  = &__interpolate_floor_int96_t
 * __INTERPOLATE_int96_t["ceil"]   = &__interpolate_ceil_int96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int96_t["nn"]     = &__interpolate_nn_int96_t
 * __INTERPOLATE_int96_t["linear"] = &__interpolate_linear_int96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1086, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1087
 * __INTERPOLATE_int96_t["floor"]  = &__interpolate_floor_int96_t
 * __INTERPOLATE_int96_t["ceil"]   = &__interpolate_ceil_int96_t
 * __INTERPOLATE_int96_t["nn"]     = &__interpolate_nn_int96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int96_t["linear"] = &__interpolate_linear_int96_t
 * __INTERPOLATE_int96_t["error"]  = &__interpolate_keys_only_int96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1087, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1088
 * __INTERPOLATE_int96_t["ceil"]   = &__interpolate_ceil_int96_t
 * __INTERPOLATE_int96_t["nn"]     = &__interpolate_nn_int96_t
 * __INTERPOLATE_int96_t["linear"] = &__interpolate_linear_int96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int96_t["error"]  = &__interpolate_keys_only_int96_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1088, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1089
 * __INTERPOLATE_int96_t["nn"]     = &__interpolate_nn_int96_t
 * __INTERPOLATE_int96_t["linear"] = &__interpolate_linear_int96_t
 * __INTERPOLATE_int96_t["error"]  = &__interpolate_keys_only_int96_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1089, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1184
 * 
 * cdef unordered_map[string, interpolate_int128_t] __INTERPOLATE_int128_t
 * __INTERPOLATE_int128_t["floor"]  = &__interpolate_floor_int128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int128_t["ceil"]   = &__interpolate_ceil_int128_t
 * __INTERPOLATE_int128_t["nn"]     = &__interpolate_nn_int128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1184, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_int128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1185
 * cdef unordered_map[string, interpolate_int128_t] __INTERPOLATE_int128_t
 * __INTERPOLATE_int128_t["floor"]  = &__interpolate_floor_int128_t
 * __INTERPOLATE_int128_t["ceil"]   = &__interpolate_ceil_int128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int128_t["nn"]     = &__interpolate_nn_int128_t
 * __INTERPOLATE_int128_t["linear"] = &__interpolate_linear_int128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1185, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_int128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1186
 * __INTERPOLATE_int128_t["floor"]  = &__interpolate_floor_int128_t
 * __INTERPOLATE_int128_t["ceil"]   = &__interpolate_ceil_int128_t
 * __INTERPOLATE_int128_t["nn"]     = &__interpolate_nn_int128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int128_t["linear"] = &__interpolate_linear_int128_t
 * __INTERPOLATE_int128_t["error"]  = &__interpolate_keys_only_int128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1186, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_int128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1187
 * __INTERPOLATE_int128_t["ceil"]   = &__interpolate_ceil_int128_t
 * __INTERPOLATE_int128_t["nn"]     = &__interpolate_nn_int128_t
 * __INTERPOLATE_int128_t["linear"] = &__interpolate_linear_int128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_int128_t["error"]  = &__interpolate_keys_only_int128_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1187, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_int128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1188
 * __INTERPOLATE_int128_t["nn"]     = &__interpolate_nn_int128_t
 * __INTERPOLATE_int128_t["linear"] = &__interpolate_linear_int128_t
 * __INTERPOLATE_int128_t["error"]  = &__interpolate_keys_only_int128_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1188, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_int128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_int128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1283
 * 
 * cdef unordered_map[string, interpolate_float32_t] __INTERPOLATE_float32_t
 * __INTERPOLATE_float32_t["floor"]  = &__interpolate_floor_float32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float32_t["ceil"]   = &__interpolate_ceil_float32_t
 * __INTERPOLATE_float32_t["nn"]     = &__interpolate_nn_float32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1283, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float32_t);

  /* "redblackpy/cython_source/interpolation.pxi":1284
 * cdef unordered_map[string, interpolate_float32_t] __INTERPOLATE_float32_t
 * __INTERPOLATE_float32_t["floor"]  = &__interpolate_floor_float32_t
 * __INTERPOLATE_float32_t["ceil"]   = &__interpolate_ceil_float32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float32_t["nn"]     = &__interpolate_nn_float32_t
 * __INTERPOLATE_float32_t["linear"] = &__interpolate_linear_float32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1284, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float32_t);

  /* "redblackpy/cython_source/interpolation.pxi":1285
 * __INTERPOLATE_float32_t["floor"]  = &__interpolate_floor_float32_t
 * __INTERPOLATE_float32_t["ceil"]   = &__interpolate_ceil_float32_t
 * __INTERPOLATE_float32_t["nn"]     = &__interpolate_nn_float32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float32_t["linear"] = &__interpolate_linear_float32_t
 * __INTERPOLATE_float32_t["error"]  = &__interpolate_keys_only_float32_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1285, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float32_t);

  /* "redblackpy/cython_source/interpolation.pxi":1286
 * __INTERPOLATE_float32_t["ceil"]   = &__interpolate_ceil_float32_t
 * __INTERPOLATE_float32_t["nn"]     = &__interpolate_nn_float32_t
 * __INTERPOLATE_float32_t["linear"] = &__interpolate_linear_float32_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float32_t["error"]  = &__interpolate_keys_only_float32_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1286, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float32_t);

  /* "redblackpy/cython_source/interpolation.pxi":1287
 * __INTERPOLATE_float32_t["nn"]     = &__interpolate_nn_float32_t
 * __INTERPOLATE_float32_t["linear"] = &__interpolate_linear_float32_t
 * __INTERPOLATE_float32_t["error"]  = &__interpolate_keys_only_float32_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1287, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float32_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float32_t);

  /* "redblackpy/cython_source/interpolation.pxi":1382
 * 
 * cdef unordered_map[string, interpolate_float64_t] __INTERPOLATE_float64_t
 * __INTERPOLATE_float64_t["floor"]  = &__interpolate_floor_float64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float64_t["ceil"]   = &__interpolate_ceil_float64_t
 * __INTERPOLATE_float64_t["nn"]     = &__interpolate_nn_float64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1382, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float64_t);

  /* "redblackpy/cython_source/interpolation.pxi":1383
 * cdef unordered_map[string, interpolate_float64_t] __INTERPOLATE_float64_t
 * __INTERPOLATE_float64_t["floor"]  = &__interpolate_floor_float64_t
 * __INTERPOLATE_float64_t["ceil"]   = &__interpolate_ceil_float64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float64_t["nn"]     = &__interpolate_nn_float64_t
 * __INTERPOLATE_float64_t["linear"] = &__interpolate_linear_float64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1383, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float64_t);

  /* "redblackpy/cython_source/interpolation.pxi":1384
 * __INTERPOLATE_float64_t["floor"]  = &__interpolate_floor_float64_t
 * __INTERPOLATE_float64_t["ceil"]   = &__interpolate_ceil_float64_t
 * __INTERPOLATE_float64_t["nn"]     = &__interpolate_nn_float64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float64_t["linear"] = &__interpolate_linear_float64_t
 * __INTERPOLATE_float64_t["error"]  = &__interpolate_keys_only_float64_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1384, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float64_t);

  /* "redblackpy/cython_source/interpolation.pxi":1385
 * __INTERPOLATE_float64_t["ceil"]   = &__interpolate_ceil_float64_t
 * __INTERPOLATE_float64_t["nn"]     = &__interpolate_nn_float64_t
 * __INTERPOLATE_float64_t["linear"] = &__interpolate_linear_float64_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float64_t["error"]  = &__interpolate_keys_only_float64_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1385, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float64_t);

  /* "redblackpy/cython_source/interpolation.pxi":1386
 * __INTERPOLATE_float64_t["nn"]     = &__interpolate_nn_float64_t
 * __INTERPOLATE_float64_t["linear"] = &__interpolate_linear_float64_t
 * __INTERPOLATE_float64_t["error"]  = &__interpolate_keys_only_float64_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1386, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float64_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float64_t);

  /* "redblackpy/cython_source/interpolation.pxi":1481
 * 
 * cdef unordered_map[string, interpolate_float80_t] __INTERPOLATE_float80_t
 * __INTERPOLATE_float80_t["floor"]  = &__interpolate_floor_float80_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float80_t["ceil"]   = &__interpolate_ceil_float80_t
 * __INTERPOLATE_float80_t["nn"]     = &__interpolate_nn_float80_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1481, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float80_t);

  /* "redblackpy/cython_source/interpolation.pxi":1482
 * cdef unordered_map[string, interpolate_float80_t] __INTERPOLATE_float80_t
 * __INTERPOLATE_float80_t["floor"]  = &__interpolate_floor_float80_t
 * __INTERPOLATE_float80_t["ceil"]   = &__interpolate_ceil_float80_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float80_t["nn"]     = &__interpolate_nn_float80_t
 * __INTERPOLATE_float80_t["linear"] = &__interpolate_linear_float80_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1482, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float80_t);

  /* "redblackpy/cython_source/interpolation.pxi":1483
 * __INTERPOLATE_float80_t["floor"]  = &__interpolate_floor_float80_t
 * __INTERPOLATE_float80_t["ceil"]   = &__interpolate_ceil_float80_t
 * __INTERPOLATE_float80_t["nn"]     = &__interpolate_nn_float80_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float80_t["linear"] = &__interpolate_linear_float80_t
 * __INTERPOLATE_float80_t["error"]  = &__interpolate_keys_only_float80_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1483, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float80_t);

  /* "redblackpy/cython_source/interpolation.pxi":1484
 * __INTERPOLATE_float80_t["ceil"]   = &__interpolate_ceil_float80_t
 * __INTERPOLATE_float80_t["nn"]     = &__interpolate_nn_float80_t
 * __INTERPOLATE_float80_t["linear"] = &__interpolate_linear_float80_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float80_t["error"]  = &__interpolate_keys_only_float80_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1484, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float80_t);

  /* "redblackpy/cython_source/interpolation.pxi":1485
 * __INTERPOLATE_float80_t["nn"]     = &__interpolate_nn_float80_t
 * __INTERPOLATE_float80_t["linear"] = &__interpolate_linear_float80_t
 * __INTERPOLATE_float80_t["error"]  = &__interpolate_keys_only_float80_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1485, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float80_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float80_t);

  /* "redblackpy/cython_source/interpolation.pxi":1580
 * 
 * cdef unordered_map[string, interpolate_float96_t] __INTERPOLATE_float96_t
 * __INTERPOLATE_float96_t["floor"]  = &__interpolate_floor_float96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float96_t["ceil"]   = &__interpolate_ceil_float96_t
 * __INTERPOLATE_float96_t["nn"]     = &__interpolate_nn_float96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1580, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1581
 * cdef unordered_map[string, interpolate_float96_t] __INTERPOLATE_float96_t
 * __INTERPOLATE_float96_t["floor"]  = &__interpolate_floor_float96_t
 * __INTERPOLATE_float96_t["ceil"]   = &__interpolate_ceil_float96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float96_t["nn"]     = &__interpolate_nn_float96_t
 * __INTERPOLATE_float96_t["linear"] = &__interpolate_linear_float96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1581, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1582
 * __INTERPOLATE_float96_t["floor"]  = &__interpolate_floor_float96_t
 * __INTERPOLATE_float96_t["ceil"]   = &__interpolate_ceil_float96_t
 * __INTERPOLATE_float96_t["nn"]     = &__interpolate_nn_float96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float96_t["linear"] = &__interpolate_linear_float96_t
 * __INTERPOLATE_float96_t["error"]  = &__interpolate_keys_only_float96_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1582, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1583
 * __INTERPOLATE_float96_t["ceil"]   = &__interpolate_ceil_float96_t
 * __INTERPOLATE_float96_t["nn"]     = &__interpolate_nn_float96_t
 * __INTERPOLATE_float96_t["linear"] = &__interpolate_linear_float96_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float96_t["error"]  = &__interpolate_keys_only_float96_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1583, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1584
 * __INTERPOLATE_float96_t["nn"]     = &__interpolate_nn_float96_t
 * __INTERPOLATE_float96_t["linear"] = &__interpolate_linear_float96_t
 * __INTERPOLATE_float96_t["error"]  = &__interpolate_keys_only_float96_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1584, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float96_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float96_t);

  /* "redblackpy/cython_source/interpolation.pxi":1679
 * 
 * cdef unordered_map[string, interpolate_float128_t] __INTERPOLATE_float128_t
 * __INTERPOLATE_float128_t["floor"]  = &__interpolate_floor_float128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float128_t["ceil"]   = &__interpolate_ceil_float128_t
 * __INTERPOLATE_float128_t["nn"]     = &__interpolate_nn_float128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1679, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_float128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1680
 * cdef unordered_map[string, interpolate_float128_t] __INTERPOLATE_float128_t
 * __INTERPOLATE_float128_t["floor"]  = &__interpolate_floor_float128_t
 * __INTERPOLATE_float128_t["ceil"]   = &__interpolate_ceil_float128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float128_t["nn"]     = &__interpolate_nn_float128_t
 * __INTERPOLATE_float128_t["linear"] = &__interpolate_linear_float128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1680, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_float128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1681
 * __INTERPOLATE_float128_t["floor"]  = &__interpolate_floor_float128_t
 * __INTERPOLATE_float128_t["ceil"]   = &__interpolate_ceil_float128_t
 * __INTERPOLATE_float128_t["nn"]     = &__interpolate_nn_float128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float128_t["linear"] = &__interpolate_linear_float128_t
 * __INTERPOLATE_float128_t["error"]  = &__interpolate_keys_only_float128_t
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1681, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_float128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1682
 * __INTERPOLATE_float128_t["ceil"]   = &__interpolate_ceil_float128_t
 * __INTERPOLATE_float128_t["nn"]     = &__interpolate_nn_float128_t
 * __INTERPOLATE_float128_t["linear"] = &__interpolate_linear_float128_t             # <<<<<<<<<<<<<<
 * __INTERPOLATE_float128_t["error"]  = &__interpolate_keys_only_float128_t
 * #
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1682, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_float128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1683
 * __INTERPOLATE_float128_t["nn"]     = &__interpolate_nn_float128_t
 * __INTERPOLATE_float128_t["linear"] = &__interpolate_linear_float128_t
 * __INTERPOLATE_float128_t["error"]  = &__interpolate_keys_only_float128_t             # <<<<<<<<<<<<<<
 * #
 * #  Created by Soldoskikh Kirill.
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1683, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_float128_t[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_float128_t);

  /* "redblackpy/cython_source/interpolation.pxi":1778
 * 
 * cdef unordered_map[string, interpolate_object] __INTERPOLATE_object
 * __INTERPOLATE_object["floor"]  = &__interpolate_floor_object             # <<<<<<<<<<<<<<
 * __INTERPOLATE_object["ceil"]   = &__interpolate_ceil_object
 * __INTERPOLATE_object["nn"]     = &__interpolate_nn_object
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_floor); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1778, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_floor_object);

  /* "redblackpy/cython_source/interpolation.pxi":1779
 * cdef unordered_map[string, interpolate_object] __INTERPOLATE_object
 * __INTERPOLATE_object["floor"]  = &__interpolate_floor_object
 * __INTERPOLATE_object["ceil"]   = &__interpolate_ceil_object             # <<<<<<<<<<<<<<
 * __INTERPOLATE_object["nn"]     = &__interpolate_nn_object
 * __INTERPOLATE_object["linear"] = &__interpolate_linear_object
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_ceil); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1779, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_ceil_object);

  /* "redblackpy/cython_source/interpolation.pxi":1780
 * __INTERPOLATE_object["floor"]  = &__interpolate_floor_object
 * __INTERPOLATE_object["ceil"]   = &__interpolate_ceil_object
 * __INTERPOLATE_object["nn"]     = &__interpolate_nn_object             # <<<<<<<<<<<<<<
 * __INTERPOLATE_object["linear"] = &__interpolate_linear_object
 * __INTERPOLATE_object["error"]  = &__interpolate_keys_only_object
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_nn); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1780, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_nn_object);

  /* "redblackpy/cython_source/interpolation.pxi":1781
 * __INTERPOLATE_object["ceil"]   = &__interpolate_ceil_object
 * __INTERPOLATE_object["nn"]     = &__interpolate_nn_object
 * __INTERPOLATE_object["linear"] = &__interpolate_linear_object             # <<<<<<<<<<<<<<
 * __INTERPOLATE_object["error"]  = &__interpolate_keys_only_object
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_linear); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1781, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_linear_object);

  /* "redblackpy/cython_source/interpolation.pxi":1782
 * __INTERPOLATE_object["nn"]     = &__interpolate_nn_object
 * __INTERPOLATE_object["linear"] = &__interpolate_linear_object
 * __INTERPOLATE_object["error"]  = &__interpolate_keys_only_object             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __pyx_convert_string_from_py_std__in_string(__pyx_n_b_error); if (unlikely(PyErr_Occurred())) __PYX_ERR(5, 1782, __pyx_L1_error)
  (__pyx_v_10redblackpy_6series_11tree_series___INTERPOLATE_object[__pyx_t_1]) = (&__pyx_f_10redblackpy_6series_11tree_series___interpolate_keys_only_object);

  /* "redblackpy/cython_source/tree_series_dtype.pxi":191
 * 
 *     cpdef __TreeSeries_uint8_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint8_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__8 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":190
 * 
 * 
 *     cpdef __TreeSeries_uint8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 191, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__8 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":207
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__9 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":206
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__9 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":794
 * 
 *     cpdef __TreeSeries_uint16_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint16_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__20 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":793
 * 
 * 
 *     cpdef __TreeSeries_uint16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 794, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__20 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":810
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__21 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":809
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__21 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1397
 * 
 *     cpdef __TreeSeries_uint32_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint32_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__30 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1396
 * 
 * 
 *     cpdef __TreeSeries_uint32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1397, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__30 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1413
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__31 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1412
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 1413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__31 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2000
 * 
 *     cpdef __TreeSeries_uint64_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint64_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__40 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":1999
 * 
 * 
 *     cpdef __TreeSeries_uint64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2000, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__40 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2016
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__41 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2015
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2016, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__41 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2603
 * 
 *     cpdef __TreeSeries_uint96_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint96_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__50 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2602
 * 
 * 
 *     cpdef __TreeSeries_uint96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2603, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__50 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2619
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__51 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":2618
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 2619, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__51 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3206
 * 
 *     cpdef __TreeSeries_uint128_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_uint128_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__60 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3205
 * 
 * 
 *     cpdef __TreeSeries_uint128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__60 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3222
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__61 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3221
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3222, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__61 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3809
 * 
 *     cpdef __TreeSeries_int8_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int8_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__70 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3808
 * 
 * 
 *     cpdef __TreeSeries_int8_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__70 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3825
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__71 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":3824
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 3825, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__71 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4412
 * 
 *     cpdef __TreeSeries_int16_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int16_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__80 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4411
 * 
 * 
 *     cpdef __TreeSeries_int16_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__80 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4428
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__81 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":4427
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 4428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__81 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5015
 * 
 *     cpdef __TreeSeries_int32_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int32_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__90 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5014
 * 
 * 
 *     cpdef __TreeSeries_int32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5015, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__90 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5031
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__91 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5030
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5031, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__91 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5618
 * 
 *     cpdef __TreeSeries_int64_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int64_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__100 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5617
 * 
 * 
 *     cpdef __TreeSeries_int64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__100 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5634
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__101 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":5633
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 5634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__101 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6221
 * 
 *     cpdef __TreeSeries_int96_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int96_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__110 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6220
 * 
 * 
 *     cpdef __TreeSeries_int96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__110 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6237
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__111 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6236
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__111 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6824
 * 
 *     cpdef __TreeSeries_int128_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_int128_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__120 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6823
 * 
 * 
 *     cpdef __TreeSeries_int128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__120 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6840
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__121 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":6839
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 6840, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__121 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7427
 * 
 *     cpdef __TreeSeries_float32_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float32_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__130 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7426
 * 
 * 
 *     cpdef __TreeSeries_float32_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7427, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__130 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7443
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__131 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":7442
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 7443, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__131 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8030
 * 
 *     cpdef __TreeSeries_float64_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float64_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__140 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8029
 * 
 * 
 *     cpdef __TreeSeries_float64_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8030, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__140 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8046
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__141 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8045
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8046, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__141 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8633
 * 
 *     cpdef __TreeSeries_float80_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float80_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__150 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8632
 * 
 * 
 *     cpdef __TreeSeries_float80_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8633, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__150 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8649
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__151 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":8648
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 8649, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__151 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9236
 * 
 *     cpdef __TreeSeries_float96_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float96_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__160 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9235
 * 
 * 
 *     cpdef __TreeSeries_float96_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__160 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9252
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__161 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9251
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__161 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9839
 * 
 *     cpdef __TreeSeries_float128_t map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_float128_t result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__170 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9838
 * 
 * 
 *     cpdef __TreeSeries_float128_t map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9839, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__170 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9855
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__171 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":9854
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 9855, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__171 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10442
 * 
 *     cpdef __TreeSeries_object map( self, method, tuple args=(),
 *                                   dict kwargs={} ):             # <<<<<<<<<<<<<<
 * 
 *         cdef __TreeSeries_object result
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__180 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10441
 * 
 * 
 *     cpdef __TreeSeries_object map( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                                   dict kwargs={} ):
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10442, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__180 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10458
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),
 *                             dict kwargs={} ) except*:             # <<<<<<<<<<<<<<
 * 
 *         cdef node_ptr it
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__181 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/cython_source/tree_series_dtype.pxi":10457
 * 
 * 
 *     cpdef void map_inplace( self, method, tuple args=(),             # <<<<<<<<<<<<<<
 *                             dict kwargs={} ) except*:
 * 
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 10458, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__181 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;

  /* "redblackpy/series/tree_series.pyx":231
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef void insert(self, key, value) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert new value at key to series.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_3insert, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_insert, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__189)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_insert, __pyx_t_2) < 0) __PYX_ERR(1, 231, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":240
 * 
 *     @cython.embedsignature(True)
 *     cpdef void insert_range(self, pairs) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Insert list of tuples (key, value) to series.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_5insert_range, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_insert_range, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__191)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_insert_range, __pyx_t_2) < 0) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":248
 * 
 *     @cython.embedsignature(True)
 *     cpdef void erase(self, key) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Erase element by key.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_7erase, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_erase, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__193)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_erase, __pyx_t_2) < 0) __PYX_ERR(1, 248, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":257
 * 
 *     @cython.embedsignature(True)
 *     cpdef begin(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns first key.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_9begin, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_begin, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__195)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 257, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_begin, __pyx_t_2) < 0) __PYX_ERR(1, 257, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":265
 * 
 *     @cython.embedsignature(True)
 *     cpdef end(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns last key.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_11end, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_end, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__197)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_end, __pyx_t_2) < 0) __PYX_ERR(1, 265, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":273
 * 
 *     @cython.embedsignature(True)
 *     cpdef list index(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of keys.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_13index, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_index, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__199)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_index, __pyx_t_2) < 0) __PYX_ERR(1, 273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":288
 * 
 *     @cython.embedsignature(True)
 *     cpdef list values(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of values.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_15values, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_values, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__201)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_values, __pyx_t_2) < 0) __PYX_ERR(1, 288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":296
 * 
 *     @cython.embedsignature(True)
 *     cpdef list items(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns list of tuples(key, value).
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_17items, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_items, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__203)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_items, __pyx_t_2) < 0) __PYX_ERR(1, 296, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":303
 * 
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<<
 *         """
 *         Returns generator of tuples(key, value).
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_19iteritems, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_iteritems, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__205)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_iteritems, __pyx_t_2) < 0) __PYX_ERR(1, 303, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":311
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple floor(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key' <= key
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_21floor, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_floor, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__207)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_floor, __pyx_t_2) < 0) __PYX_ERR(1, 311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":320
 * 
 *     @cython.embedsignature(True)
 *     cpdef tuple ceil(self, key):             # <<<<<<<<<<<<<<
 *         """
 *         Returns tuple (key', value') such that key <= key'
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_23ceil, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_ceil, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__209)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_ceil, __pyx_t_2) < 0) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":329
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series truncate(self, start, stop):             # <<<<<<<<<<<<<<
 *         """
 *         Truncation from start until stop.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_25truncate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_truncate, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__211)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_truncate, __pyx_t_2) < 0) __PYX_ERR(1, 329, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":344
 * 
 *     @cython.embedsignature(True)
 *     cpdef Series uniform(self, start, stop, step):             # <<<<<<<<<<<<<<
 *         """
 *         Returns uniform grid Series from start until stop
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_27uniform, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_uniform, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__213)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_uniform, __pyx_t_2) < 0) __PYX_ERR(1, 344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":360
 * 
 *     @cython.embedsignature(True)
 *     cpdef map(self, method, bint inplace=False, tuple args=(), dict kwargs={}):             # <<<<<<<<<<<<<<
 *         """
 *         Apply method to each value in series.
 */
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__187 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_k__187 = ((PyObject*)__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_29map, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_map, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__215)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_map, __pyx_t_2) < 0) __PYX_ERR(1, 360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":378
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_interpolation(self, str interpolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_31set_interpolation, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_set_interpolation, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__217)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_set_interpolation, __pyx_t_2) < 0) __PYX_ERR(1, 378, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":387
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_extrapolation(self, extrapolate):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_33set_extrapolation, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_set_extrapolation, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__219)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_set_extrapolation, __pyx_t_2) < 0) __PYX_ERR(1, 387, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":396
 * 
 *     @cython.embedsignature(True)
 *     cpdef void set_arithmetic(self, str arithmetic):             # <<<<<<<<<<<<<<
 *         """
 *         Set interpolation type.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_35set_arithmetic, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_set_arithmetic, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__221)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_set_arithmetic, __pyx_t_2) < 0) __PYX_ERR(1, 396, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":405
 * 
 *     @cython.embedsignature(True)
 *     cpdef void on_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn on linear search for operator[].
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_37on_itermode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_on_itermode, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__223)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 405, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_on_itermode, __pyx_t_2) < 0) __PYX_ERR(1, 405, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":413
 * 
 *     @cython.embedsignature(True)
 *     cpdef void off_itermode(self):             # <<<<<<<<<<<<<<
 *         """
 *         Turn off linear search for operator[].
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_39off_itermode, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_off_itermode, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__225)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_off_itermode, __pyx_t_2) < 0) __PYX_ERR(1, 413, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":421
 * 
 *     @cython.embedsignature(True)
 *     cpdef void cast_dtype(self, str dtype) except*:             # <<<<<<<<<<<<<<
 *         """
 *         Cast values to specific dtype.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_41cast_dtype, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_cast_dtype, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__227)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_cast_dtype, __pyx_t_2) < 0) __PYX_ERR(1, 421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":800
 *     #--------------------------------------------------------------------------------------------
 *     @cython.embedsignature(True)
 *     cpdef to_pandas(self):             # <<<<<<<<<<<<<<
 *         """
 *         Convert to pandas.Series.
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_43to_pandas, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_to_pandas, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__229)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 800, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_to_pandas, __pyx_t_2) < 0) __PYX_ERR(1, 800, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":810
 * 
 *     @staticmethod
 *     def from_pandas( pd_series, str interpolate='floor', extrapolate=0,             # <<<<<<<<<<<<<<
 *                      str arithmetic='left' ):
 *         """
 */
  __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_45from_pandas, __Pyx_CYFUNCTION_STATICMETHOD | __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series_from_pandas, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__231)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_from_pandas, __pyx_t_2) < 0) __PYX_ERR(1, 810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":809
 * 
 * 
 *     @staticmethod             # <<<<<<<<<<<<<<
 *     def from_pandas( pd_series, str interpolate='floor', extrapolate=0,
 *                      str arithmetic='left' ):
 */
  __pyx_t_2 = __Pyx_GetNameInClass((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series, __pyx_n_s_from_pandas); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 810, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_staticmethod, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_from_pandas, __pyx_t_3) < 0) __PYX_ERR(1, 810, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":827
 *     # Special methods
 *     #--------------------------------------------------------------------------------------------
 *     def __del__(self):             # <<<<<<<<<<<<<<
 * 
 *         self.dtype_series.__del__()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_47__del__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series___del, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__233)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_del, __pyx_t_3) < 0) __PYX_ERR(1, 827, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":966
 *     # Pickle serialization
 *     #--------------------------------------------------------------------------------------------------
 *     def __reduce__(self):             # <<<<<<<<<<<<<<
 * 
 *         return Series, (), self.__getstate__()
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_77__reduce__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series___reduce, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__235)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_reduce, __pyx_t_3) < 0) __PYX_ERR(1, 966, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":971
 * 
 * 
 *     def __getstate__(self):             # <<<<<<<<<<<<<<
 * 
 *         cdef dict state = {}
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_79__getstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series___getstate, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__237)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 971, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_getstate, __pyx_t_3) < 0) __PYX_ERR(1, 971, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":985
 * 
 * 
 *     def __setstate__(self, dict state):             # <<<<<<<<<<<<<<
 * 
 *         self.name = state['name']
 */
  __pyx_t_3 = __Pyx_CyFunction_NewEx(&__pyx_mdef_10redblackpy_6series_11tree_series_6Series_81__setstate__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Series___setstate, NULL, __pyx_n_s_redblackpy_series_tree_series, __pyx_d, ((PyObject *)__pyx_codeobj__239)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 985, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_10redblackpy_6series_11tree_series_Series->tp_dict, __pyx_n_s_setstate, __pyx_t_3) < 0) __PYX_ERR(1, 985, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PyType_Modified(__pyx_ptype_10redblackpy_6series_11tree_series_Series);

  /* "redblackpy/series/tree_series.pyx":1
 * #             # <<<<<<<<<<<<<<
 * #  Created by Soldoskikh Kirill.
 * #  Copyright  2018 Intuition. All rights reserved.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "string.from_py":13
 * 
 * @cname("__pyx_convert_string_from_py_std__in_string")
 * cdef string __pyx_convert_string_from_py_std__in_string(object o) except *:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t length
 *     cdef const char* data = __Pyx_PyObject_AsStringAndSize(o, &length)
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init redblackpy.series.tree_series", 0, __pyx_lineno, __pyx_filename);
    }
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init redblackpy.series.tree_series");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule((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

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
#include "frameobject.h"
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = f->f_localsplus;
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
#else
    if (likely(PyCFunction_Check(func))) {
#endif
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyErrFetchRestore */
  #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* WriteUnraisableException */
  static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* RaiseException */
  #if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* None */
  static CYTHON_INLINE int __Pyx_div_int(int a, int b) {
    int q = a / b;
    int r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* None */
  static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t b) {
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t q = a / b;
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int32_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* None */
  static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t b) {
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t q = a / b;
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int64_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* None */
  static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t b) {
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t q = a / b;
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int96_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* None */
  static CYTHON_INLINE __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t __Pyx_div___pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t(__pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t a, __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t b) {
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t q = a / b;
    __pyx_t_10redblackpy_15tree_cython_api_13types_mapping_int128_t r = a - q*b;
    q -= ((r != 0) & ((r ^ b) < 0));
    return q;
}

/* RaiseDoubleKeywords */
  static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
  static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* ArgTypeTest */
  static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
{
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    else if (exact) {
        #if PY_MAJOR_VERSION == 2
        if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
        #endif
    }
    else {
        if (likely(__Pyx_TypeCheck(obj, type))) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

/* ExtTypeTest */
  static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* IterFinish */
  static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* PyObjectCallMethod0 */
  static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method, *result = NULL;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) goto bad;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *function = PyMethod_GET_FUNCTION(method);
            result = __Pyx_PyObject_CallOneArg(function, self);
            Py_DECREF(method);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack */
  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck */
  static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* RaiseNoneIterError */
  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
  static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
  static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = Py_TYPE(iter)->tp_iternext;
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
  static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* BytesEquals */
  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* pyobject_as_double */
  static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
    float_value = PyNumber_Float(obj);  if (0) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* SliceTupleAndList */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_crop_slice(Py_ssize_t* _start, Py_ssize_t* _stop, Py_ssize_t* _length) {
    Py_ssize_t start = *_start, stop = *_stop, length = *_length;
    if (start < 0) {
        start += length;
        if (start < 0)
            start = 0;
    }
    if (stop < 0)
        stop += length;
    else if (stop > length)
        stop = length;
    *_length = stop - start;
    *_start = start;
    *_stop = stop;
}
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject** CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject* __Pyx_PyList_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyList_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyList_New(0);
    dest = PyList_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyListObject*)src)->ob_item + start,
        ((PyListObject*)dest)->ob_item,
        length);
    return dest;
}
static CYTHON_INLINE PyObject* __Pyx_PyTuple_GetSlice(
            PyObject* src, Py_ssize_t start, Py_ssize_t stop) {
    PyObject* dest;
    Py_ssize_t length = PyTuple_GET_SIZE(src);
    __Pyx_crop_slice(&start, &stop, &length);
    if (unlikely(length <= 0))
        return PyTuple_New(0);
    dest = PyTuple_New(length);
    if (unlikely(!dest))
        return NULL;
    __Pyx_copy_object_array(
        ((PyTupleObject*)src)->ob_item + start,
        ((PyTupleObject*)dest)->ob_item,
        length);
    return dest;
}
#endif

/* PyIntBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) {
            Py_RETURN_TRUE;
        } else {
            Py_RETURN_FALSE;
        }
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
                default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
                #else
                default: Py_RETURN_FALSE;
                #endif
            }
        }
            if (a == b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            if ((double)a == (double)b) {
                Py_RETURN_TRUE;
            } else {
                Py_RETURN_FALSE;
            }
    }
    return PyObject_RichCompare(op1, op2, Py_EQ);
}
#endif

/* PyObjectCallMethod1 */
  static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = NULL;
#if CYTHON_UNPACK_METHODS
    if (likely(PyMethod_Check(method))) {
        PyObject *self = PyMethod_GET_SELF(method);
        if (likely(self)) {
            PyObject *args;
            PyObject *function = PyMethod_GET_FUNCTION(method);
            #if CYTHON_FAST_PYCALL
            if (PyFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            #if CYTHON_FAST_PYCCALL
            if (__Pyx_PyFastCFunction_Check(function)) {
                PyObject *args[2] = {self, arg};
                result = __Pyx_PyCFunction_FastCall(function, args, 2);
                goto done;
            }
            #endif
            args = PyTuple_New(2);
            if (unlikely(!args)) goto done;
            Py_INCREF(self);
            PyTuple_SET_ITEM(args, 0, self);
            Py_INCREF(arg);
            PyTuple_SET_ITEM(args, 1, arg);
            Py_INCREF(function);
            result = __Pyx_PyObject_Call(function, args, NULL);
            Py_DECREF(args);
            Py_DECREF(function);
            return result;
        }
    }
#endif
    result = __Pyx_PyObject_CallOneArg(method, arg);
    goto done;
done:
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method, *result;
    method = __Pyx_PyObject_GetAttrStr(obj, method_name);
    if (unlikely(!method)) return NULL;
    result = __Pyx__PyObject_CallMethod1(method, arg);
    Py_DECREF(method);
    return result;
}

/* pop_index */
  static PyObject* __Pyx__PyObject_PopNewIndex(PyObject* L, PyObject* py_ix) {
    PyObject *r;
    if (unlikely(!py_ix)) return NULL;
    r = __Pyx__PyObject_PopIndex(L, py_ix);
    Py_DECREF(py_ix);
    return r;
}
static PyObject* __Pyx__PyObject_PopIndex(PyObject* L, PyObject* py_ix) {
    return __Pyx_PyObject_CallMethod1(L, __pyx_n_s_pop, py_ix);
}
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static PyObject* __Pyx__PyList_PopIndex(PyObject* L, PyObject* py_ix, Py_ssize_t ix) {
    Py_ssize_t size = PyList_GET_SIZE(L);
    if (likely(size > (((PyListObject*)L)->allocated >> 1))) {
        Py_ssize_t cix = ix;
        if (cix < 0) {
            cix += size;
        }
        if (likely(0 <= cix && cix < size)) {
            PyObject* v = PyList_GET_ITEM(L, cix);
            Py_SIZE(L) -= 1;
            size -= 1;
            memmove(&PyList_GET_ITEM(L, cix), &PyList_GET_ITEM(L, cix+1), (size_t)(size-cix)*sizeof(PyObject*));
            return v;
        }
    }
    if (py_ix == Py_None) {
        return __Pyx__PyObject_PopNewIndex(L, PyInt_FromSsize_t(ix));
    } else {
        return __Pyx__PyObject_PopIndex(L, py_ix);
    }
}
#endif

/* GetItemInt */
  static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* ObjectGetItem */
  #if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* PyObjectSetAttrStr */
  #if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* Import */
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* DictGetItem */
  #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            PyObject* args = PyTuple_Pack(1, key);
            if (likely(args))
                PyErr_SetObject(PyExc_KeyError, args);
            Py_XDECREF(args);
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* CallNextTpTraverse */
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
  static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObject_GenericGetAttrNoDict */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetVTable */
  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    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;
}

/* SetupReduce */
  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* FetchCommonType */
  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
  #include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* PyErrExceptionMatches */
      #if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetModuleGlobalName */
      static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    if (likely(result)) {
        Py_INCREF(result);
    } else if (unlikely(PyErr_Occurred())) {
        result = NULL;
    } else {
#else
    result = PyDict_GetItem(__pyx_d, name);
    if (likely(result)) {
        Py_INCREF(result);
    } else {
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    if (!result) {
        PyErr_Clear();
#endif
        result = __Pyx_GetBuiltinName(name);
    }
    return result;
}

/* GetNameInClass */
          static PyObject *__Pyx_GetGlobalNameAfterAttributeLookup(PyObject *name) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    return __Pyx_GetModuleGlobalName(name);
}
static PyObject *__Pyx_GetNameInClass(PyObject *nmspace, PyObject *name) {
    PyObject *result;
    result = __Pyx_PyObject_GetAttrStr(nmspace, name);
    if (!result) {
        result = __Pyx_GetGlobalNameAfterAttributeLookup(name);
    }
    return result;
}

/* CLineInTraceback */
          #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
      use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (PyObject_Not(use_cline) != 0) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
          static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
          #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntFromPyVerify */
          #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_char(unsigned char value) {
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned char),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_short(unsigned short value) {
    const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned short) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned short) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned short) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned short),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_PY_LONG_LONG(unsigned PY_LONG_LONG value) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned PY_LONG_LONG),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_signed__char(signed char value) {
    const signed char neg_one = (signed char) -1, const_zero = (signed char) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(signed char) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(signed char) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(signed char) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(signed char) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(signed char) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(signed char),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_short(short value) {
    const short neg_one = (short) -1, const_zero = (short) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(short) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(short) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(short) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(short),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
          static CYTHON_INLINE PyObject* __Pyx_PyInt_From_PY_LONG_LONG(PY_LONG_LONG value) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(PY_LONG_LONG),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
          static CYTHON_INLINE unsigned char __Pyx_PyInt_As_unsigned_char(PyObject *x) {
    const unsigned char neg_one = (unsigned char) -1, const_zero = (unsigned char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned char, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) >= 2 * PyLong_SHIFT) {
                            return (unsigned char) (((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) >= 3 * PyLong_SHIFT) {
                            return (unsigned char) (((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) >= 4 * PyLong_SHIFT) {
                            return (unsigned char) (((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned char) (((unsigned char)-1)*(((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned char) ((((((unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned char) (((unsigned char)-1)*(((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned char) ((((((((unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned char) (((unsigned char)-1)*(((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned char) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned char) ((((((((((unsigned char)digits[3]) << PyLong_SHIFT) | (unsigned char)digits[2]) << PyLong_SHIFT) | (unsigned char)digits[1]) << PyLong_SHIFT) | (unsigned char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned char) -1;
        }
    } else {
        unsigned char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned char) -1;
        val = __Pyx_PyInt_As_unsigned_char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned char");
    return (unsigned char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned char");
    return (unsigned char) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *x) {
    const unsigned short neg_one = (unsigned short) -1, const_zero = (unsigned short) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned short) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned short, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned short) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned short) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned short, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) >= 2 * PyLong_SHIFT) {
                            return (unsigned short) (((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) >= 3 * PyLong_SHIFT) {
                            return (unsigned short) (((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) >= 4 * PyLong_SHIFT) {
                            return (unsigned short) (((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned short) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned short) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned short) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned short) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned short, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned short,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned short) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned short) (((unsigned short)-1)*(((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned short) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned short) ((((((unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned short) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned short) (((unsigned short)-1)*(((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned short) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned short) ((((((((unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned short) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned short) (((unsigned short)-1)*(((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned short) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned short) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned short) ((((((((((unsigned short)digits[3]) << PyLong_SHIFT) | (unsigned short)digits[2]) << PyLong_SHIFT) | (unsigned short)digits[1]) << PyLong_SHIFT) | (unsigned short)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned short) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned short, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned short) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned short, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned short val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned short) -1;
        }
    } else {
        unsigned short val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned short) -1;
        val = __Pyx_PyInt_As_unsigned_short(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned short");
    return (unsigned short) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned short");
    return (unsigned short) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_As_unsigned_PY_LONG_LONG(PyObject *x) {
    const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG) -1, const_zero = (unsigned PY_LONG_LONG) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(unsigned PY_LONG_LONG) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned PY_LONG_LONG) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned PY_LONG_LONG) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, digit, digits[0])
                case 2:
                    if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned PY_LONG_LONG) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned PY_LONG_LONG) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(unsigned PY_LONG_LONG) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) ((((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(unsigned PY_LONG_LONG) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) ((((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) (((unsigned PY_LONG_LONG)-1)*(((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(unsigned PY_LONG_LONG) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(unsigned PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(unsigned PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                            return (unsigned PY_LONG_LONG) ((((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(unsigned PY_LONG_LONG) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(unsigned PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            unsigned PY_LONG_LONG val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned PY_LONG_LONG) -1;
        }
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned PY_LONG_LONG) -1;
        val = __Pyx_PyInt_As_unsigned_PY_LONG_LONG(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned PY_LONG_LONG");
    return (unsigned PY_LONG_LONG) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned PY_LONG_LONG");
    return (unsigned PY_LONG_LONG) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE signed char __Pyx_PyInt_As_signed__char(PyObject *x) {
    const signed char neg_one = (signed char) -1, const_zero = (signed char) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(signed char) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(signed char, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (signed char) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (signed char) 0;
                case  1: __PYX_VERIFY_RETURN_INT(signed char, digit, digits[0])
                case 2:
                    if (8 * sizeof(signed char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) >= 2 * PyLong_SHIFT) {
                            return (signed char) (((((signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(signed char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) >= 3 * PyLong_SHIFT) {
                            return (signed char) (((((((signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(signed char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) >= 4 * PyLong_SHIFT) {
                            return (signed char) (((((((((signed char)digits[3]) << PyLong_SHIFT) | (signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (signed char) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(signed char) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(signed char, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(signed char) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(signed char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (signed char) 0;
                case -1: __PYX_VERIFY_RETURN_INT(signed char, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(signed char,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(signed char) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) - 1 > 2 * PyLong_SHIFT) {
                            return (signed char) (((signed char)-1)*(((((signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(signed char) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) - 1 > 2 * PyLong_SHIFT) {
                            return (signed char) ((((((signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(signed char) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) - 1 > 3 * PyLong_SHIFT) {
                            return (signed char) (((signed char)-1)*(((((((signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(signed char) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) - 1 > 3 * PyLong_SHIFT) {
                            return (signed char) ((((((((signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(signed char) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) - 1 > 4 * PyLong_SHIFT) {
                            return (signed char) (((signed char)-1)*(((((((((signed char)digits[3]) << PyLong_SHIFT) | (signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(signed char) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(signed char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(signed char) - 1 > 4 * PyLong_SHIFT) {
                            return (signed char) ((((((((((signed char)digits[3]) << PyLong_SHIFT) | (signed char)digits[2]) << PyLong_SHIFT) | (signed char)digits[1]) << PyLong_SHIFT) | (signed char)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(signed char) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(signed char, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(signed char) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(signed char, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            signed char val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (signed char) -1;
        }
    } else {
        signed char val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (signed char) -1;
        val = __Pyx_PyInt_As_signed__char(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to signed char");
    return (signed char) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to signed char");
    return (signed char) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE short __Pyx_PyInt_As_short(PyObject *x) {
    const short neg_one = (short) -1, const_zero = (short) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(short) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(short, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (short) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (short) 0;
                case  1: __PYX_VERIFY_RETURN_INT(short, digit, digits[0])
                case 2:
                    if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) >= 2 * PyLong_SHIFT) {
                            return (short) (((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) >= 3 * PyLong_SHIFT) {
                            return (short) (((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) >= 4 * PyLong_SHIFT) {
                            return (short) (((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (short) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(short) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(short, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(short) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(short, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (short) 0;
                case -1: __PYX_VERIFY_RETURN_INT(short, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(short,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(short) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
                            return (short) (((short)-1)*(((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(short) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
                            return (short) ((((((short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(short) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
                            return (short) (((short)-1)*(((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(short) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
                            return (short) ((((((((short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(short) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
                            return (short) (((short)-1)*(((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(short) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(short, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(short) - 1 > 4 * PyLong_SHIFT) {
                            return (short) ((((((((((short)digits[3]) << PyLong_SHIFT) | (short)digits[2]) << PyLong_SHIFT) | (short)digits[1]) << PyLong_SHIFT) | (short)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(short) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(short, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(short) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(short, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            short val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (short) -1;
        }
    } else {
        short val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (short) -1;
        val = __Pyx_PyInt_As_short(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to short");
    return (short) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to short");
    return (short) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) -1, const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_As_PY_LONG_LONG(PyObject *x) {
    const PY_LONG_LONG neg_one = (PY_LONG_LONG) -1, const_zero = (PY_LONG_LONG) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(PY_LONG_LONG) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (PY_LONG_LONG) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (PY_LONG_LONG) 0;
                case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, digit, digits[0])
                case 2:
                    if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) >= 2 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) >= 3 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) >= 4 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (PY_LONG_LONG) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(PY_LONG_LONG) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(PY_LONG_LONG) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (PY_LONG_LONG) 0;
                case -1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(PY_LONG_LONG,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(PY_LONG_LONG) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(PY_LONG_LONG) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) ((((((PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(PY_LONG_LONG) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) ((((((((PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) (((PY_LONG_LONG)-1)*(((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(PY_LONG_LONG) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(PY_LONG_LONG, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                            return (PY_LONG_LONG) ((((((((((PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (PY_LONG_LONG)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(PY_LONG_LONG) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(PY_LONG_LONG) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(PY_LONG_LONG, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            PY_LONG_LONG val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (PY_LONG_LONG) -1;
        }
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (PY_LONG_LONG) -1;
        val = __Pyx_PyInt_As_PY_LONG_LONG(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to PY_LONG_LONG");
    return (PY_LONG_LONG) -1;
}

/* CIntFromPy */
          static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) -1, const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* FastTypeChecks */
          #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* SaveResetException */
          #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if PY_VERSION_HEX >= 0x030700A2
    *type = tstate->exc_state.exc_type;
    *value = tstate->exc_state.exc_value;
    *tb = tstate->exc_state.exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A2
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = type;
    tstate->exc_state.exc_value = value;
    tstate->exc_state.exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* SwapException */
          #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if PY_VERSION_HEX >= 0x030700A2
    tmp_type = tstate->exc_state.exc_type;
    tmp_value = tstate->exc_state.exc_value;
    tmp_tb = tstate->exc_state.exc_traceback;
    tstate->exc_state.exc_type = *type;
    tstate->exc_state.exc_value = *value;
    tstate->exc_state.exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* CoroutineBase */
          #include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__pyx_CoroutineObject *self) {
    PyObject *exc_type = self->exc_type;
    PyObject *exc_value = self->exc_value;
    PyObject *exc_traceback = self->exc_traceback;
    self->exc_type = NULL;
    self->exc_value = NULL;
    self->exc_traceback = NULL;
    Py_XDECREF(exc_type);
    Py_XDECREF(exc_value);
    Py_XDECREF(exc_traceback);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if (0) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if (0) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    if (self->exc_type) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        if (self->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
#endif
        __Pyx_ExceptionSwap(&self->exc_type, &self->exc_value,
                            &self->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(self);
        __Pyx_ExceptionSave(&self->exc_type, &self->exc_value, &self->exc_traceback);
    }
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__pyx_CoroutineObject *self) {
    if (likely(self->exc_traceback)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) self->exc_traceback;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    Py_VISIT(gen->exc_type);
    Py_VISIT(gen->exc_value);
    Py_VISIT(gen->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    Py_CLEAR(gen->exc_type);
    Py_CLEAR(gen->exc_value);
    Py_CLEAR(gen->exc_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value))) {
#else
    if (unlikely(value == NULL || !PyString_Check(value))) {
#endif
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->exc_type = NULL;
    gen->exc_value = NULL;
    gen->exc_traceback = NULL;
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
              static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
              #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
              static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
              static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* FunctionExport */
              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
    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;
}

/* ModuleImport */
              #ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    py_name = __Pyx_PyIdentifier_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

/* TypeImport */
              #ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    size_t size, int strict)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;
    char warning[200];
    Py_ssize_t basicsize;
#ifdef Py_LIMITED_API
    PyObject *py_basicsize;
#endif
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    py_name = __Pyx_PyIdentifier_FromString(class_name);
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s.%.200s is not a type object",
            module_name, class_name);
        goto bad;
    }
#ifndef Py_LIMITED_API
    basicsize = ((PyTypeObject *)result)->tp_basicsize;
#else
    py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
    if (!py_basicsize)
        goto bad;
    basicsize = PyLong_AsSsize_t(py_basicsize);
    Py_DECREF(py_basicsize);
    py_basicsize = 0;
    if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
        goto bad;
#endif
    if (!strict && (size_t)basicsize > size) {
        PyOS_snprintf(warning, sizeof(warning),
            "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
    }
    else if ((size_t)basicsize != size) {
        PyErr_Format(PyExc_ValueError,
            "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
            module_name, class_name, basicsize, size);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return NULL;
}
#endif

/* InitStrings */
              static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(x);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
